Follow-up Comment #1, bug #66365 (group findutils):

Implicit in Geoff's comment is that the rules for terminating the expression
are different for the ";" and "+" cases.   The full wording from the standard
(IEEE Std 1003.1-2024) is:

-exec utility_name [argument ...] ;
-exec utility_name [argument ...]  {} +

The end of the primary expression shall be punctuated by a <semicolon> or by a
<plus-sign>. Only a <plus-sign> that immediately follows an argument
containing only the two characters "{}" shall punctuate the end of the primary
expression. Other uses of the <plus-sign> shall not be treated as special.
If the primary expression is punctuated by a <semicolon>, the utility
utility_name shall be invoked once for each pathname and the primary shall
evaluate as true if the utility returns a zero value as exit status. A
utility_name or argument containing only the two characters "{}" shall be
replaced by the current pathname. If a utility_name or argument string
contains the two characters "{}", but not just the two characters "{}", it is
implementation-defined whether find replaces those two characters or uses the
string without change.

If the primary expression is punctuated by a <plus-sign>, the primary shall
always evaluate as true, and the pathnames for which the primary is evaluated
shall be aggregated into sets. The utility utility_name shall be invoked once
for each set of aggregated pathnames. Each invocation shall begin after the
last pathname in the set is aggregated, and shall be completed before the find
utility exits and before the first pathname in the next set (if any) is
aggregated for this primary, but it is otherwise unspecified whether the
invocation occurs before, during, or after the evaluations of other primaries.
If any invocation returns a non-zero value as exit status, the find utility
shall return a non-zero exit status. An argument containing only the two
characters "{}" shall be replaced by the set of aggregated pathnames, with
each pathname passed as a separate argument to the invoked utility in the same
order that it was aggregated. The size of any set of two or more pathnames
shall be limited such that execution of the utility does not cause the
system's {ARG_MAX} limit to be exceeded. If more than one argument containing
the two characters "{}" is present, the behavior is unspecified.

The current directory for the invocation of utility_name shall be the same as
the current directory when the find utility was started. If the utility_name
names any of the special built-in utilities (see 2.15 Special Built-In
Utilities ), the results are undefined.


    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?66365>

_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/

Attachment: signature.asc
Description: PGP signature

Reply via email to