Subject: Re: Recursive grep (where is limfree defined?)
To: None <current-users@NetBSD.ORG>
From: Jeff Thieleke <thieleke@icaen.uiowa.edu>
List: current-users
Date: 01/23/1996 01:31:39
> >> find /usr/src/sys -name '*.c' -exec grep '^limfree' '{}' /dev/null \;
> > 
> > I found this patch today on the FreeBSD hackers mailing list.  It patches
> > the grep source to allow recursive searches.  Compared to the find method
> > shown above, it is about 3-4x faster.
> 
> I don't know why this would be, since the NetBSD-current "find" already uses
> the FTS routines (see fts(3)) that are the main brunt of the patch that you
> posted.


It is due to the way this particular find statment was written.  If I am not 
mistaken, it starts a new grep process for each file encountered.  A 
better method, using pipes and xargs was posted, but it goes to show how 
treacherous using find for what (IMHO) grep could and should do.
 

Jeff Thieleke