Subject: Re: Stopping wildcard expansion?
To: Richard Rauch <rkr@rkr.kcnet.com>
From: Frederick Bruckman <fb@enteract.com>
List: netbsd-users
Date: 01/11/2000 00:57:14
On Mon, 10 Jan 2000, Richard Rauch wrote:

> Two ways work from csh:

csh!!! I guess we bashers have nothing to be ashamed of...

>  * Along similar lines, use xargs(1):
> 
>      find . | xargs -n 1 grep variable
> 
>    ...the pipe can be broken with ^C, as per usual.

Here' my "fast find" bash function. This should work under sh, too.

 ff () { find ${PWD} ! -name tags -printx | xargs grep -l $1 | \
 LESS=+/$1 xargs less ; }

To use, "cd .../blah/foo; ff bar", then use "{ESC} n n n ..." to comb
through all the matched files, highlighting any instances of "bar".
One possible improvement would be to not catch directories, *.o files
and such. You could easily set "find" to only do Makefile's.