grep annoyance!

plug-devel@lists.PLUG.phoenix.az.us plug-devel@lists.PLUG.phoenix.az.us
Fri Apr 15 11:22:02 2005


On Fri, 15 Apr 2005, Austin Godber wrote:
> I don't know if there is an option for grep ... it would be nice ... but
> you can use find's -exec feature in conjunction with grep like this:
> 
> 
> find . -iname "*.c" -exec grep include {} \;
> 
> It will search below the current directory for any file ending in .c or
> .C and grep anything it finds for the string "include".

What I dislike about that method is that it doesn't include the filename 
of where it found the text.  I tend to use:

find . -name "*.c" | xargs grep include

	--Ted