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 01:57:55
On Tue, 11 Jan 2000, Richard Rauch wrote:
> > 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 ; }
>
> Why ${PWD} rather than . ?
So "=" in less displays the full path to the file. If I came back to
the xterm a couple of days later, I can usually infer from that what I
was doing and what I was looking for. Otherwise I'd have to quit back
to the shell to see what directory I'm in, and do the search all over.
(It's not really all that "fast".)
> > 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.
>
> Err, of course. Did he want to just look at Makefiles? (^&
Yes, he's looking for gremlins in pkgsrc. You know, wiz, grep has an
-r option? I think it's faster, though, to let xargs spawn multiple
greps, but that's just my impression.