[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: grep -r problem
From: |
Stepan Kasal |
Subject: |
Re: grep -r problem |
Date: |
Tue, 13 May 2003 15:44:57 +0200 |
User-agent: |
Mutt/1.2.5.1i |
Hello all,
> > find -name "*.c" | xargs grep void
On Mon, May 12, 2003 at 10:30:07AM -0400, KOYLE,RUSS (HP-Boise,ex1) wrote:
> Sure seems like it would be easier to have it look for just *.c files
> regardless of the direction (still recursing) and avoid the use of the extra
> 'find'.
this definitely is a matter of taste. A possible answer is that tools should
be simple and the power is in combining them together. (Strictly speaking,
the mere -r breaks the style :-)
Another possible answer is this: in the command
grep xxx *.c
it's not the grep code which searches for all *.c files in the current
directory. In a UNIX-style environment, it's the shell.
It's possible to use more powerful shell, eg. zsh, which enables this,
for example
grep xxx **/*.c
Though I don't use zsh personally, I think this solution is better then
fiddleing with grep options. Thus I wouldn't like to see the grep code
``enhanced'' in this respect. Just my humble opinion.
Have a nice day,
Stepan