|
From: | Eric Backus |
Subject: | Re: grep -R "include" *.c --- not working |
Date: | Fri, 1 Oct 2004 12:24:35 -0700 |
Stepan Kasal wrote:Damian Gutierrez wrote: > > grep -R "include" *.c this searches for *.c in current dir. There is no such file. This doesn't search subdirectories. What you meant is grep -R --include='*.c' include .Call me a purist but I still think finding files is best left to find. find . -name '*.c' -print0 | xargs -r0 grep include Bob
find . -name '*.c' -print0 | xargs -r0 grep include /dev/nullThis ensures that grep always preceeds the match with a filename, even if there's only one file found.
-- Eric Backus
[Prev in Thread] | Current Thread | [Next in Thread] |