Mail Archives: cygwin/2000/02/16/16:28:24
On 14 February 2000 19:32, Bob McGowan [mailto:Robert DOT McGowan AT veritas DOT com]
wrote:
>
> $ bash --version
> GNU bash, version 2.03.0(2)-release (i686-pc-cygwin)
> Copyright 1998 Free Software Foundation, Inc.
>
> Following is the output of your test cases, using the above version of
> bash. spaces1 uses the "for" loop and "$@", spaces2 uses the "while"
> loop with "$1" and "shift":
>
> DF>[test cases quoted at end]
>
> $ spaces1 "a b c" "there are 2 tabs: :" "and a third arg"
> a b c
> there are 2 tabs: :
> and a third
>
> $ spaces2 "a b c" "there are 2 tabs: :" "and a third arg"
> a b c
> there are 2 tabs: :
> and a third
>
> I cut and pasted the above from my cygwin bash window. Note that the
> tab characters _were_ there, they just didn't translate in
> the cut/paste
> ;-)
This is interesting because I've now tried the simple cases in both bash and
ash and they do the right thing, as above.
There was obviously a cygwin interaction in the following chain,
schematically:
CreateProcess("sh.exe -c '/Program\ Files/longpathto/op_mko.sh
"`/bin/cygpath -u "c:\windows\filenameof\model_file"`"')
*** suspect space in scriptname *^*
where in op_mko.sh:
#!/bin/bash
# stuff
for model in "$@"; do
echo "$model"
# more stuff
done
So it looks as though something is happening around the translation of the
lpCommandLine of CreateProcess to the argv[argc] of sh.exe's exec of
/bin/bash as the script processor for op_mko.sh. As I have a good
work-around I'll let this rest until I've got the next net release
installed.
/df
> Dirk Fieldhouse wrote:
> >
> > I'm not sure that this is a specific CYGWIN issue, but I
> don't have access to a bash on a machine that allows spaces
> in filenames (surely the underscore character was invented to
> avoid these ...)
> >
> > In bash 2.01.1 (b20.1/W95B), the following sequences which
> should have identical behaviour do not:
> >
> > #!/bin/bash
> > for arg in "$@" ; do
echo "$arg" # splits "arg with spaces" into 3 args
done
> >
> > #!/bin/bash
> > while [ "$1" ] ; do
> > echo "$1" # maintains "arg with spaces" as one argument
> > shift
> > done
> >
> > I haven't tested these against ash, nor with the latest
> bash release (2.03?), and I would be delighted to hear that
> this is a historical problem.
> >
> > I am sure that the second behaviour is correct, especially
> given the bash manual's description of $@.
> >
> > --
> > Dirk Fieldhouse Logica UK Limited
> > fieldhouse AT logica DOT com 75 Hampstead Road
> > c=gb;a=attmail;p=logica; London NW1 2PL
> > o=LOGICA;ou1=UK;s=fieldhouse UK
> > +44 (20) 7637 9111
> > - not speaking for Logica
> >
> > --
> > Want to unsubscribe from this list?
> > Send a message to cygwin-unsubscribe AT sourceware DOT cygnus DOT com
>
> --
> Bob McGowan
> Staff Software Quality Engineer
> VERITAS Software
> rmcgowan AT veritas DOT com
>
--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe AT sourceware DOT cygnus DOT com
- Raw text -