Subject: re: `find' command broken.
From: [email-masked] ("John Cooper")

11 Jul 1997 09:21:16 -0700
Approved: [email-masked]
Distribution: cygnus
Message-ID: <19970711133409718.AAA335.cygnus.gnu-win32@TENDLE>
References: <19970711092719531.AAA303@TENDLE>
	<[email-masked]>
Reply-To: [email-masked]
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Original-To: James Dumser <[email-masked]>
Original-Cc: [email-masked], [email-masked],
        Amol Deshpande <[email-masked]>
In-Reply-To: <[email-masked]>
X-Mailer: VM 6.32 under Emacs 19.34.1
X-Attribution: JSC
X-Face: -%]aecOJlhOSKn)}>~DbRQwM6G6gDkOD{2f!2Bt9|S-xC1~Gk^dCp_/HH#zo^u5z8iGty3N
 L_1.GYkj0by`^VQK14EzbsY~BC%%O#x+[Giaf?X`hi9H)oEy]M>cx/Y4.I^5@^#kQrJk*!DwlpX: 1}
 eZVU9: ~_QGIMF5[I
Original-Sender: [email-masked]

James Dumser writes:
 > >    H:\ef>find . -name *.c -print
 > >    find: paths must precede expression
 > >    Usage: find [path...] [expression]
 > >    H:\ef>
 > 
 > And the fact that cmd does not glob is the "problem": bash globs; but 
 > since cmd doesn't, cygwin32 globs for it (because Unix programs expect 
 > globbing to be done). 

Well, if cygwin32 globs, why doesn't it work under cmd.exe?

    H:\ef>dir
     Directory of H:\ef
    11/07/97  09:48                      0 a.c
    11/07/97  09:48                      0 b.c
		   4 File(s)              0 bytes
				589,430,784 bytes free

    H:\ef>find . -name *.c -print
    find: paths must precede expression
    Usage: find [path...] [expression]

    H:\ef>find . -name '*.c' -print

    H:\ef>

 > This will work under bash IFF there are no .c files in the current 
 > directory (bash tries to glob; but since there are no matches, it leaves
 > it alone) -- in which case, running under cmd should have the same 
 > results). Did you run your tests (cmd vs bash) from the same directory?

Right.  I realize bash globs, but *so does zsh*, and yet `find' doesn't work
under zsh.

Could it be that cygwin.dll is somehow doing the globbing for zsh (even when
the *.c is in quotes)?

Here's the failure under zsh:

    zsh$ find . -name '*.c' -print                                            H:/
    /c/gnuwin32/b18/h-i386-cygwin32/bin/find.EXE: paths must precede expression
    Usage: /c/gnuwin32/b18/h-i386-cygwin32/bin/find.EXE [path...] [expression]
    zsh$ ls *.c                                                               H:/
    a.c  b.c
    zsh$                                                                      H:/

Here, (oddly) it works under bash:

    bash$ find . -name '*.c' -print
    ./a.c
    ./b.c

The following shows that both zsh and bash pass exactly the same string to
the `find' command:

zsh$ echo find . -name '*.c' -print
find . -name *.c -print
zsh$

bash$ echo find . -name '*.c' -print
find . -name *.c -print
bash$

I can only guess that the find command (cygwin32.dll) *knows* that it's been
invoked by bash and then doesn't try to do the glob?  Under zsh, the extra
glob appears to be done by find (cygwin32.dll?)

Thanks,

    --- John

-
For help on using this list (especially unsubscribing), send a message to
"[email-masked]" with one line of text: "help".