all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#3479: rgrep sends directories needlessly to grep
@ 2009-06-05 21:39 jidanni
  2019-10-06  4:50 ` Stefan Kangas
  2019-10-10 22:33 ` 積丹尼 Dan Jacobson
  0 siblings, 2 replies; 4+ messages in thread
From: jidanni @ 2009-06-05 21:39 UTC (permalink / raw)
  To: bug-gnu-emacs

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.)






^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-10-10 23:32 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-06-05 21:39 bug#3479: rgrep sends directories needlessly to grep jidanni
2019-10-06  4:50 ` Stefan Kangas
2019-10-10 22:33 ` 積丹尼 Dan Jacobson
2019-10-10 23:32   ` Stefan Kangas

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.