Pierre Fortin wrote:
...
> I would think this indicates that "find" is buggy since the "-o|-or|," does not
> seem to work as documented...  comments...?
...

find(1) is a first-class bitch of a program.  It consistently trips me 
up with it's arcane syntax and unexpected behavior.

In this case, you are being bitten by the fact that find follows the 
file globbing behavior of the shell (from 'info find'):
      In the `find' tests that do shell pattern matching (`-name',
   `-path', etc.), wildcards in the pattern do not match a `.' at the
   beginning of a file name.

Your problem with '-or' is that there is an implied '-and' before 
'-print', so that you are really doing 'a or b and c', which is 
different than 'b or a and c' because 'and' has higher precedence.  If 
you use parens (or drop the '-print'), it works as you expect:

$ find . \( -iname '.test*' -o -iname 'test*' \) -print
./.test
./.test/test1
./.test/test1/test2
./.test/test1/test2/TEST2
./.test/test1/TEST1
./.test/.test1
./.test/.test1/.test2
./.test/.test1/.test2/.TEST2
./.test/.test1/.TEST1

As far as the original problem, I would suggest keeping the find part as 
simple as possible and use grep to do the matching:

$ find . -type f | grep test

Or, more precisely:

$ find . -type f | grep 'read[^/]*$'

to limit the match to the filename component.

<Joe



Want to buy your Pack or Services from MandrakeSoft? 
Go to http://www.mandrakestore.com

Reply via email to