bug-gnu-utils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: grep -R "include" *.c --- not working


From: Eric Backus
Subject: Re: grep -R "include" *.c --- not working
Date: Fri, 1 Oct 2004 12:24:35 -0700

"Bob Proulx" <address@hidden> wrote in message news:address@hidden
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/null

This ensures that grep always preceeds the match with a filename, even if there's only one file found.

--
Eric Backus



reply via email to

[Prev in Thread] Current Thread [Next in Thread]