In the case of:

find  ... -exec cmd {} \;

The exit status of cmd is used to determines whether the
predicate evaluates to true or false.

For instance:

find . -exec test -d {} \; -print

Would print the paths of the files that are directories or
symlink to directories, the standard equivalent of the
GNU-specific:

find . -xtype d -print

If you want find to be aborted with a non-zero exit status as
soon as any invocation of cmd fails, you could do:

find . \( -exec cmd {} \; -o -exec sh -c 'kill "$PPID"' \; \)

In the case of:

find ... -exec cmd {} +

The predicate always evaluates to true, but the exit status of
find will be non-zero if any of the invocation of find will
return with a non-zero exit status.

-- 
Stephane


Reply via email to