From owner-freebsd-hackers@FreeBSD.ORG Sun Mar 27 21:18:33 2005 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6585916A4CE for ; Sun, 27 Mar 2005 21:18:33 +0000 (GMT) Received: from mailhost.stack.nl (vaak.stack.nl [131.155.140.140]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7446243D4C for ; Sun, 27 Mar 2005 21:18:32 +0000 (GMT) (envelope-from jilles@stack.nl) Received: from turtle.stack.nl (turtle.stack.nl [IPv6:2001:610:1108:5010::132]) by mailhost.stack.nl (Postfix) with ESMTP id 8C8F31F025 for ; Sun, 27 Mar 2005 23:18:31 +0200 (CEST) Received: by turtle.stack.nl (Postfix, from userid 1677) id 6CBE61CD4B; Sun, 27 Mar 2005 23:18:31 +0200 (CEST) Date: Sun, 27 Mar 2005 23:18:31 +0200 From: Jilles Tjoelker To: freebsd-hackers@freebsd.org Message-ID: <20050327211831.GD6814@stack.nl> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Operating-System: FreeBSD 5.3-RELEASE-p5 i386 User-Agent: Mutt/1.5.6i Subject: find -exec {} + fails with -or and ! (bin/79263) X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Mar 2005 21:18:33 -0000 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