bug-grep
[Top][All Lists]
Advanced

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

Re: grep using the recursive option


From: Stepan Kasal
Subject: Re: grep using the recursive option
Date: Wed, 7 Mar 2012 09:07:36 +0100
User-agent: Mutt/1.5.19 (2009-01-05)

Hello anonymous,

> grep -r index *.rb

this is a common misunderstanding.  The issue is that shell performs
the "expansion" of *.rb before grep starts.

The recursive search is, in genereal case, done by a special tool
named find/xargs:

find . -name '*.rb' |xargs grep index

But the re are also other alternatives, like grep's --include option
or Z shell and its recursive expansion
        grep -r index **/*.rb

And, BTW, this was not the right place to ask, you got this answer by
shere luck.

Regards,
        Stepan Kasal



reply via email to

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