Sat 02 Sep 2006 08:05:12 AM UTC, comment #1:
Hello,
as you already guessed this is no bug.
<quote>
The expression is made up of options (which affect overall operation rather than the processing of a specific file, and always return true), tests (which return a true or false value), and actions (which have side effects and return a true or false value), all separated by operators. -and is assumed where the operator is omitted.
If the expression contains no actions other than -prune, -print is performed on all files for which the expression is true.
<unquote>
So the whole thing is depending on the order the options, tests and commands are specified.
-------------------
metzler@argenau:/tmp/findtest$ echo blah > notempty ; touch empty
ametzler@argenau:/tmp/findtest$ find -size 0 -print
./empty
ametzler@argenau:/tmp/findtest$ find -print -size 0
.
./notempty
./empty
ametzler@argenau:/tmp/findtest$ find -print -size 0 -print
.
./notempty
./empty
./empty
-------------------
The second command FIRST prints all entries and afterwards checks their size (and does nothing with result of the test as there is no action specified and because the commandline already contains an action, the "-print"). The first command does what you wanted it to do.
The third one illustrates the point, it prints all entries, then checks the size and prints the entries with size=0.
hth, cu andreas
|