This is the mail archive of the
mailing list for the Cygwin project.
Re: bash scripts fail with bash3.1-8
Am Tue, 3 Oct 2006 17:02:29 +0100
schrieb "Dave Korn" :
> On 03 October 2006 16:43, Turly O'Connor wrote:
> > By way of an example as to what broke, note that in the following
> > that "cleartool" is not a cygwin tool (it's a Windows executable),
> > writing its CRLF-terminated output to Windows' stdout.
> > CHECKOUTS=`cleartool lsc -all -cvi -s` # list all my checkouts
> > I used to be able to do
> > for one in $CHECKOUTS ; do echo $one Hello ; done
> > C:/Path/To/file1 Hello
> > C:/Path/To/file2 Hello
> > Now it seems that "$one" above contains the binary CR, so I get:
> > Hello h/To/file1
> > Hello h/To/file2
> > What do I need to do to get this working again?
> How about
> CHECKOUTS=`cleartool lsc -all -cvi -s | d2u` # list all my checkouts
> for one in $((echo $CHECKOUTS | d2u)) ; do echo $one Hello ; done
> depending on how happy cleartool is on piping output to a cygwin
This is exactly the problem I have with my sqlplus call.
Is there a way to solve it without introducing the d2u filter ?
What I do is:
RESULT=`sqplus -s user/ps@DATABASE << EOF
and it is easy to change it to
RESULT=`sqplus -s user/ps@DATABASE << EOF | d2u
For native UNIX systems the "d2u" command is unnecessary.
I could do something like
D2U="| d2u" under Cygwin
D2U="" under UNIX
RESULT=`sqplus -s user/ps@DATABASE << EOF | $D2U
But this still requires that I touch the scripts.
And we have a lot of such scripts, Cygwin is just one platform and I
have not access to all shell sources.
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html