[plug] hidden files

James Devenish devenish at guild.uwa.edu.au
Wed Aug 20 11:59:51 WST 2003


In message <OF56952BFC.71385BF2-ON48256D88.000FADEA at au1.ibm.com>
on Wed, Aug 20, 2003 at 10:59:18AM +0800, Richard Meyer wrote:
> Hmm, I've used expressions of the form "-name fred*" before, but maybe
> there is a problem with ".*". I don't have a Linux box around to check.

It don't think it's anything to do with Linux per se, it's a design trap
of Bash's. AFAIK (and I'm not a Bash user), when Bash cannot expand a
pattern it passes the pattern through to the programme verbatim and
without warning. That is to say: using the bareword fred* works by luck
because either (a) the shell is doing find's work for it or (b) you have
no fred* files in the current directory. On the other hand, this
behaviour can cause incorrect results. For example, if you have a file
called fredX in the current directory and a file called fredY in a
subdirectory, `find` would fail to find fredY (because of what Bash did
to your command). If you delete fredX, `find` will then be able to
locate fredY. (So it is probably best for everyone to quote their
arguments when using `find`?)




More information about the plug mailing list