GNU bug report logs - #3479
rgrep sends directories needlessly to grep

Previous Next

Package: emacs;

Reported by: jidanni <at> jidanni.org

Date: Sat, 6 Jun 2009 05:25:04 UTC

Severity: minor

Done: 積丹尼 Dan Jacobson <jidanni <at> jidanni.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: jidanni <at> jidanni.org
Subject: bug#3479: closed (Re: bug#3479: rgrep sends directories
 needlessly to grep)
Date: Thu, 10 Oct 2019 23:26:02 +0000
[Message part 1 (text/plain, inline)]
Your bug report

#3479: rgrep sends directories needlessly to grep

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to 3479 <at> debbugs.gnu.org.

-- 
3479: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3479
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: 積丹尼 Dan Jacobson <jidanni <at> jidanni.org>
To: Stefan Kangas <stefan <at> marxist.se>
Cc: 3479-done <at> debbugs.gnu.org
Subject: Re: bug#3479: rgrep sends directories needlessly to grep
Date: Fri, 11 Oct 2019 06:33:28 +0800
SK> This was reported 10 years ago.  If you still remember what it's
SK> about, could you please explain how to reproduce whatever issue this
SK> is inside Emacs?  And what is the issue here exactly?  I'm not sure I
SK> understand.

Hard for me to remember too. So I'll close it.

[Message part 3 (message/rfc822, inline)]
From: jidanni <at> jidanni.org
To: bug-gnu-emacs <at> gnu.org
Subject: rgrep sends directories needlessly to grep
Date: Sat, 06 Jun 2009 05:39:40 +0800
Gentlemen, I used the same string as e.g.,
(rgrep "bla" "*" "~/mediawiki/")
produced, and instead appended fgrep, and found
$ find . \( -path \*/CVS -o -path \*/.svn -o -path \*/\{arch\} -o -path \*/.hg -o -path \*/_darcs -o -path \*/.git -o -path \*/.bzr \) -prune -o  -type f \( -name \* \)|fgrep -c .svn
62
That's right, 62 .svn's, when you thought you had eliminated them. They
are all directories.

OK, now putting the print inside ( ),
$ cd ~/mediawiki/;find  . -path \*/.svn  -prune -o \( -type f \( -name \* \) -print \)|fgrep .svn
./math/.svnignore
./tests/.svnignore
Which were put there by the staff, so we have indeed eliminated what we
need to!

Therefore consider putting your ...-print0 inside a ( )!

Also only one space is needed between "-o  -type f".

(Of course grep doesn't give an error when given a directory.)



This bug report was last modified 5 years and 286 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.