This is the mail archive of the cygwin mailing list for the Cygwin project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Inconsistency in find ... -name ...

Eric Blake wrote:
Using find, I didn't protect spec in -name (-name 'spec') in a couple of
instances but they still worked, viz-a-viz:
$ find /home/lowella -type f -name *.h
whereas a couple of others didn't work, viz-a-viz:
$ find /home/lowella -type f -name *.txt
find: paths must precede expression
Usage: find [-H] [-L] [-P] [path...] [expression]
echo is your friend. Try:

$ echo /home/lowella -type f -name *.h

And notice that since there are no .h files in the current
directory, the shell passes the glob through unchanged
to find. You can also do 'shopt -s nullglob' to change that.
I've wondered about this. Does bash special case the find command then? Which other commands does is special case like this?
Don't tell anyone, but duct tape is The Force. It has a dark side, and a light side, and it binds the Universe together.

-- Unsubscribe info: Problem reports: Documentation: FAQ:

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]