[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug #31005] -exec {} + and -execdir {} + are always true (but documenta
From: |
Aaron D. Ball |
Subject: |
[bug #31005] -exec {} + and -execdir {} + are always true (but documentation does not say so) |
Date: |
Thu, 09 Sep 2010 22:47:43 +0000 |
User-agent: |
Mozilla/5.0 (X11; U; Linux x86_64; en-US) AppleWebKit/534.6 (KHTML, like Gecko) Ubuntu/10.04 Chromium/7.0.505.0 Chrome/7.0.505.0 Safari/534.6 |
URL:
<http://savannah.gnu.org/bugs/?31005>
Summary: -exec {} + and -execdir {} + are always true (but
documentation does not say so)
Project: findutils
Submitted by: adb
Submitted on: Thu 09 Sep 2010 06:47:42 PM EDT
Category: find
Severity: 3 - Normal
Item Group: Wrong result
Status: None
Privacy: Public
Assigned to: None
Originator Name:
Originator Email:
Open/Closed: Open
Discussion Lock: Any
Release: 4.4.2
Fixed Release: None
_______________________________________________________
Details:
A naive user (e.g., I until a few minutes ago) would expect both of these
commands
find -exec false \; -o -print
find -exec false '{}' \+ -o -print
to print all the files in the directory tree. Instead, the former prints
everything and the latter prints nothing: i.e., the multi-argument form of
"-exec" always returns true.
Since the documentation doesn't say anything about the truth values differing
between the two forms of the statement, it seems natural to expect that, if
-exec foo {} + invokes
foo file1 file2 ...
then the truth value at each file used in the invocation would be equal to
the truth value of the whole invocation.
After thinking about it a little while, I see that we might need the truth
value for file1 before we can decide whether to feed file2 to the command, so
there may not be a logical way to fix this. In any case, the documentation
should accurately describe the behavior of the '+' variant of the commands.
(In my own selfish interest, I should point out that the way I'm using this
feature would actually work fine if the truth value were always "true" for
every file but the last one in a command invocation, which *is* logically
possible to implement.)
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/bugs/?31005>
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [bug #31005] -exec {} + and -execdir {} + are always true (but documentation does not say so),
Aaron D. Ball <=