[QUOTE=MrUmunhum;5263517]
Quote:
Originally Posted by rknichols
but that means the previous '-name' options are no-ops? Should that have caused an error message?
|
All of those "options" are just elements in a boolean expression which can be quite complex. In cases like yours, it's easy to see that those terms could never cause evaluation of any action element, but in general that is not easy to determine. For the case where there is no action element at all,
find does use a default action of "-print" if the overall expression evaluates to
true, but if there
is any action,
find just evaluates the expression you supplied, and if that does not involve any action, so be it.
FWIW, the C compiler too does not require that a conditional expression result in any action that has side effects. The following is valid C and compiles without warnings, even with "-Wall" as long as variable
x is defined and set. In fact, the pointless test gets optimized out entirely.
Quote:
In the future I must remember to use parentheses.
|
We've all made that same mistake. In fact, I made it myself about an hour after posting my reply.