Bug Report: File globbing in CMD shell

cygwin@sourceware.cygnus.com cygwin@sourceware.cygnus.com
Wed Jun 30 22:10:00 GMT 1999


On Thu, Jun 10, 1999 at 02:43:02PM -0400, Henry Gessau wrote:
>Hmmm. That doesn't quite make sense either. I tried the same thing on
>Solaris:
>
>$ ls tmpdir/*
>tmpdir/tmp.txt
>$ ls tmpdir\*
>tmpdir*: No such file or directory
>$ ls tmpdir\\*
>ls: No match.
>$ ls tmpdir\tmp.txt
>tmpdirtmp.txt: No such file or directory

As I stated in another mail, the arguments to a cygwin program are not
globbed unless an unquoted wildcard character is seen.  Cygwin does
collapse a quoted backslash to a backslash, however.  It also leaves
single backslashes, that do not quote anything "special", alone.

I don't see this as being too inconsistent.  We can't emulate UNIX
behavior 100% because backslashes do mean something to Windows.

>Note the difference between the fourth example above and the fourth example
>below. It looks like Cygwin is trying to accommodate the DOS backslash path
>separator when invoked from CMD.EXE, but it is not very logical when the
>argument contains an asterisk.
>
>My opinion is that backslash should not quote the next character when using
>CMD.EXE (at least there should be an option for specifying this).
>
>I would like to have a look at the file globbing code - any hints as to
>where I might find it? (I have not delved into the Cygwin sources before.)

It is in the winsup sources.  Grep for 'glob'.

cgf

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com



More information about the Cygwin mailing list