[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: grep 2.4.2 -r option broken
From: |
Bob Proulx |
Subject: |
Re: grep 2.4.2 -r option broken |
Date: |
Sun, 19 May 2002 12:01:20 -0600 |
User-agent: |
Mutt/1.3.28i |
> "King, Steven R" <address@hidden> wrote:
> > grep -r "struct timeval" *.h
Paul wrote an excellent reply.
> Wildcard expansion is performed by the shell; -r is handled by grep,
> but only applies to whatever arguments are given to it by the shell.
> In this case, the shell expands *.h to a list of all header files in
> the current directory, and passes those to grep. grep would recurse
> on those, since -r was given, but none of them are directories. This
> will do what you want:
> find . -name '*.h' | xargs grep "struct timeval" /dev/null
You may also find this FAQ entry useful. It describes this behavior in
some detail.
http://www.gnu.org/software/fileutils/doc/faq/core-utils-faq.html#Why%20doesn't%20rm%20-r%20*.pattern%20recurse%20like%20it%20should%3f
Bob