bug-gnu-utils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: grep patch


From: Stepan Koltsov
Subject: Re: grep patch
Date: Fri, 18 Jan 2002 19:54:43 +0300
User-agent: Mutt/1.3.25i

On Fri, Jan 18, 2002 at 09:27:22AM -0500, Alain Magloire wrote:
...
> > > No, you've got it backwards.  grep didn't have -r for many years, but
> > > many ordinary users kept asking for it, so it got added to grep.  As
> > > far as I know you are the only one who's ever asked for anything like
> > > --fake-filename.
> > 
> > You should answer them -- use find. grep with option -r cannot do a lot
> > of things, that find + grep can, for instance, I often do something
> > like:
> > find . -name '*.h' | xargs grep -w uint32_t
> > 
> > find intended for finding files, grep -- for grepping them :-)
> 
> grep --include=*.h -r uint32_t .
> 
> 
> --include --exclude as been part of 2.5e(should in 2.5f) for sometimes.
> They were not meant to replace find, but rather a quicker way to 
> express this particular idiom.

Maybe more proper way is to modify grep, allowing it to take filelist
from file, including stdin? Then we can do something like:

find . -name '*.h' | grep --filelist=- pattern
or even
find . -name '*.h' -print0 | grep --filelist0=- pattern

Find will find, grep will grep, perfomace will be good :-)

-- 
mailto:address@hidden
irc.openprojects.net/#debian-russian



reply via email to

[Prev in Thread] Current Thread [Next in Thread]