Now what would you expect this to print out?

Sébastien Morand seb.morand at gmail.com
Mon May 19 10:10:06 UTC 2008


> Riddle for the day for folks that have source trees... what would you expect
> this to print out (ask yourself the question and then execute the command)?
>
>     find /usr/src -name Makefile -or -name '*.mk' -print
>
> The expected output and what actual output differed in my mind, but maybe
> somebody else can "shed some light" on the logic behind what happened [I
> read through the find(1) code and can see why it does what it does, but I
> still don't find the result useful].

Looks like you wanted to do this:

find /usr/src \( -name Makefile -o -name '*.mk' \) -print

Implicit operator is and (-a) and is arithmetic, and is equivalent to
multiplication, or is equivalent to addition ... so and as the
priority.


More information about the freebsd-questions mailing list