Mail Archives: djgpp/1998/08/04/02:53:01
On 4 Aug 1998, Davin Max Pearson wrote:
> When I "CD" to a directory that does contain "*.cc" files, I then
> try the following variations of the find command, with the
> following results:
This is all expected behavior, please read the manuals of Findutils
and Bash, and sections 16.1 and 16.2 of the DJGPP FAQ list.
`find' needs to get the wildcard unaltered, since it wants to test
the name of every file it finds against that wildcard. However, if
you don't quote the wildcards, they will be expanded by the DJGPP
startup code (or by Bash, if you run `find' from Bash), and `find'
gets a list of file names instead.
The best way to quote wildcards is to use '', like this:
find . -name '*.cc'
This is the best because it works both from command.com and from Bash
on DOS/Windows, and also on Unix. So if you get accustomed to this
quoting style, you keep your sanity on any platform.
Other quoting methods will fail in some cases.
> (4) From BASH:
>
> find . -name "*.cc"
>
> doesn't work (paths must precede expression)
It does work for me. Did you actually type this exact command line?
> (5) From BASH:
>
> find . -name "\*.cc"
>
> does nothing.
That's because the backslash in "\*.cc" is taken as the root
directory. Use either "*.cc" or \*.cc, and then it will work (it does
for me).
I suggest not to use `\' as the escape character, since the DJGPP
ports generally uses `\' as a directory separator, except before ' or
".
- Raw text -