Re: Grep puzzle. Bug?
On Tue, Aug 20, 2002 at 22:07:09 +0100, Richard Kimber wrote:
> I don't seem to be able to get the grep I have ( 2.4.2-3) to search
> recursively. The man page gives a -r option for this, and this is what
> I've always used with my previous distro. Is there a bug?
No.
> Or am I using it incorrectly?
Yes.
> grep -r text *.htm
>
> only finds text in the current directory,
Which is exactly what you're requesting. First the shell does the globbing,
rewriting the line to something like
grep -r text foo.htm bar.htm baz.htm
then grep searches through these, recursively (which is the same as
non-recursively, as its argument list consists of files only, no
directories).
For a recursive search in the current directory, do "grep -r text .".
HTH,
Ray
--
"I'm just waiting to see `Red Hat to acquire Abominable Snowman & Department
of Defense in Massive Stock Swap.'"
Hemos in http://slashdot.org/article.pl?sid=99/12/16/1741211
Reply to: