This is the mail archive of the
mailing list for the Cygwin project.
Re: cygpath "$@" in a script: bug?
- From: Randall R Schulz <rrschulz at cris dot com>
- To: cygwin at cygwin dot com
- Date: Mon, 10 Mar 2003 09:48:05 -0800
- Subject: Re: cygpath "$@" in a script: bug?
Yes. Well, no. Cygpath isn't "chok[ing]." It's operating correctly.
It accepts one input name per line when used in filter mode. You can
use tr or sed to insert newlines where appropriate, but it's not
feasible to have cygpath interpret spaces as separators between input
names. Since spaces are valid in file names, that's the only reasonable
(reasonably general) way for it to work. (Yes, under Unix / Linux /
etc., newlines are acceptable file name characters, too, but are rarely
used as such.)
At 00:47 2003-03-10, Ralf Hauser wrote:
in http://sources.redhat.com/ml/cygwin/2003-01/msg01707.html I thought to
see how I should do this.
The example works fine. But if I create a script that does
echo "$@" | cygpath -w -f -
and call it with
testscript `/bin/ls /bin/ch*`
C:\cygwin\bin\checkgid.exe \bin\chgrp.exe \bin\chmod.exe \bin\chown.exe
is it possible that it chokes upon missing newlines (CR/LF)?
Or even worse if I put in the long path:
testscript `/bin/ls /cygdrive/c/cygwin/bin/ch*`
cygpath: error converting "/cygdrive/c/cygwin/bin/checkgid.exe
or yet worse when I do that on my desktop with three test files a.txt,
aa.txt and aaa.txt:
rhauser at PC:/<3>rhauser/Desktop>
testscript `ls /cygdrive/c/Docume~1/rhauser/Desktop/a*.txt`
so the first path is converted properly while number 2 and 3 are wrong?
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Bug reporting: http://cygwin.com/bugs.html