On 04/04/2011 10:47 PM, Peggy Russell wrote: > The bottom line seemed to be, I wasn't sure when an implicit `print` was going > to occur. Ah! Now I get it. If the expression contains *any action* anywhere, > the user must provide all actions.
Correct, for the right definition of actions. > The exception to that rule is `-prune`. It is > the absent of any action that creates: > > `\( entire expression \) -a -print` -prune is not an action. According to POSIX: http://pubs.opengroup.org/onlinepubs/9699919799/utilities/find.html only -exec, -ok, and -print are actions (all other POSIX-mandated primaries are non-actions). Since -prune is POSIX-mandated, I think we have a documentation bug - -prune should be listed among the TESTS section of the man page rather than the ACTIONS section. Meanwhile, since -delete, -execdir, -fls, -fprint, -fprint0, -fprintf, -ls, -okdir, -print0, -printf, and -quit are not mandated by POSIX, it makes sense for GNU findutils to describe those as additional actions that suppress the implicit -print behavior. But, once we account for the documentation bug of -prune being listed in the wrong section, your analysis of several sample commands and when the implicit \( \) -print is added are correct. -- Eric Blake [email protected] +1-801-349-2682 Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature
