[forwarding to bug-findutils]
On 09/03/2010 11:00 AM, Geoff Clare wrote:
James,
I saw Eric's mail in the bug-findutils archive where he said:
POSIX says, for -exec ... +:
"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."
Implementation-defined is a bear - it means we have to pick one of those
two behaviors, and document it; we are not allowed to pick an alternate
third behavior (rejecting with an error message).
I believe Eric is mistaken about this. POSIX says
"Only a<plus-sign> that immediately follows an argument
containing the two characters "{}" shall punctuate the end of the
primary expression. Other uses of the<plus-sign> shall not be
treated as special."
So according to POSIX,
find . -exec TURNIP{} +
does not have a terminator on the -exec. So you are right to give
an error message, although perhaps you are giving a misleading one.
find plainfile -exec TURNIP{} + \;
is valid and should execute either TURNIP{} or TURNIPplainfile.
Interesting - that indeed implies more work to get this correct.
However, it also means that we have to think about this case:
find . -exec TURNIP{} {} +
It fits the rules for -exec ... +, but what to do about the {} in the
command name "TURNIP{}".
--
Eric Blake ebl...@redhat.com +1-801-349-2682
Libvirt virtualization library http://libvirt.org