From: dbe AT wgn DOT net ("$Bill Luebkert") Subject: Re: `find' command broken. 12 Jul 1997 09:31:17 -0700 Approved: cygnus DOT gnu-win32 AT cygnus DOT com Distribution: cygnus Message-ID: <33C79F98.101D.cygnus.gnu-win32@wgn.net> References: <19970711092719531 DOT AAA303 AT TENDLE> <19970711133409718 DOT AAA335 AT TENDLE> <33C6B5BF DOT BA9 AT wgn DOT net> <33C76150 DOT A2F58F7F AT prairienet DOT org> Reply-To: dbe AT wgn DOT net Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Mailer: Mozilla 3.01Gold (Win95; I) Original-To: Gilligan <_kunglao AT prairienet DOT org> Original-CC: GNU-Win32 AT cygnus DOT com Original-Sender: owner-gnu-win32 AT cygnus DOT com Gilligan wrote: > > $Bill Luebkert wrote: > > > > John Cooper wrote: > > command.com works (does a globbed find) if I leave the quotes off, > > tcsh and bash work if I put the quotes on, which is what you would > > expect, except for the gotcha. It only works if there > > are no files matching the glob in the current dir (the one you're > > sitting in, not the effective starting dir). Strange problem! > > Globbing works that way, and has for years in the Unix world. If you > do: ls -l *.c, the appropriate shell (or is it cygwin.dll?), does the > search for any .c files from the current directory, and pastes them into > the arguments for the program. So ls (or find, or whatever program) > would only see "ls -l a.c b.c" in it's argv[] array. When you then look > at the find above, done with globbing and the two .c files, the find > command sees "find . -name a.c b.c -print" Not when you have the single quotes around '*.c'. That escapes the arg from globbing. > > It acts like find is globbing the name against the current dir prior > > to picking up the args or executing the command. If I knew > > where the source for find was, I would take a look at it. > > That's the way Unix has been, and will always be. On the other hand, > some shells allow you to set a variable to disable globbing. I'm not > sure if cygwin.dll pays any attention to it. I think it is "set > noglob," read the man page of bash to see if it has a similar setting. When you escape the arg with single quotes, the arg is passed to the command intact, no globbing is to be performed. Since it works from a dir that doesn't have any .c files in it, I have to assume that the arg is passed to the task as *.c not a.b b.c otherwise the dirs further down in the tree would fail and not print out the .c files found there. No, this appears to be a problem in find IMHO, or at least not the shell. But time will tell. Anyone know where the source is? -- ,-/- __ _ _ $Bill Luebkert (_/ / ) // // DBE Collectibles / ) /--< o // // http://www.wgn.net/~dbe/ -/-' /___/_<_