[prev in list] [next in list] [prev in thread] [next in thread]
List: freebsd-hackers
Subject: find -exec {} + fails with -or and ! (bin/79263)
From: Jilles Tjoelker <jilles () stack ! nl>
Date: 2005-03-27 21:18:31
Message-ID: 20050327211831.GD6814 () stack ! nl
[Download RAW message or body]
The current implementation of the final (possibly only) execution of
find -exec {} + is incomplete and only works if the -exec is on the top
level of (implicitly) -and'ed primaries, not if it is behind -or or !. I
have a patch for this in PR bin/79263.
Examples (copied from PR):
Simple not-so-practical example (/home/jilles/tmp/find is the patched version
of /usr/src/usr.bin/find):
jilles@jaguar /home/jilles/tmp% find find \! -exec echo {} +
(no output)
jilles@jaguar /home/jilles/tmp% find/find find \! -exec echo {} +
find find/option.c find/extern.h find/find.1 find/find.c find/find.h find/function.c \
find/getdate.y find/ls.c find/main.c find/misc.c find/operator.c find/Makefile \
find/find.o find/function.o find/ls.o find/main.o find/misc.o find/operator.o \
find/option.o find/getdate.c find/getdate.o find/find find/find.1.gz
(expected output)
Practical example (searching through a Subversion checkout):
jilles@jaguar /home/jilles/src/svn/hyperion% find . \( -name .svn -prune \) -o -type \
f -exec grep -i silence /dev/null {} +
(no output)
jilles@jaguar /home/jilles/src/svn/hyperion% ~/tmp/find/find . \( -name .svn -prune \
\) -o -type f -exec grep -i silence /dev/null {} +
(expected output, snipped here)
In comparison:
jilles@jaguar /home/jilles/src/svn/hyperion% find . \( -name .svn -prune \) -o -type \
f -print0 | xargs -0 grep -i silence /dev/null
gives the expected output, even without the patch.
--
Jilles Tjoelker
_______________________________________________
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org"
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic