bug-findutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: find . -exec TURNIP{} +


From: Eric Blake
Subject: Re: find . -exec TURNIP{} +
Date: Fri, 03 Sep 2010 11:41:42 -0600
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.8) Gecko/20100806 Fedora/3.1.2-1.fc13 Mnenhy/0.8.3 Thunderbird/3.1.2

[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   address@hidden    +1-801-349-2682
Libvirt virtualization library http://libvirt.org



reply via email to

[Prev in Thread] Current Thread [Next in Thread]