Re: Grep puzzle. Bug?
%% Richard Kimber <rkimber@ntlworld.com> writes:
rk> On Tue, 20 Aug 2002 23:26:20 +0200
rk> "J.H.M. Dassen (Ray)" <dm@zensunni.demon.nl> wrote:
>> > Or am I using it incorrectly?
>> Yes.
rk> OK. Fine. Thanks. I didn't think it likely to be a bug. But
rk> have you any idea why, with Mandrake, I was able to use it
rk> "incorrectly" and still get the desired result? I.e. it did read
rk> all files under each directory, recursively, according to the
rk> pattern given (e.g. *.htm). Could the shell have been set up
rk> differently?
There's no shell that will expand *.htm to resolve to all files matching
that pattern in subdirectories, regardless of how it's set (that would
be incredibly dangerous!!).
Of course if you had a _directory_ whose name ended in .htm, then the
command would have searched that. But no other directories. BTW, if
the shell did that expansion for you, why did you need the -r option to
grep at all?
There are some shells (like zsh) which will do this kind of recursive
wildcard expansion given other patterns, but not just *.htm. And I
don't know of any Linux (or other) distribution that sets up zsh as a
user's shell by default, so you would have had to ask for it
explicitly.
--
-------------------------------------------------------------------------------
Paul D. Smith <pausmith@nortelnetworks.com> HASMAT--HA Software Mthds & Tools
"Please remain calm...I may be mad, but I am a professional." --Mad Scientist
-------------------------------------------------------------------------------
These are my opinions---Nortel Networks takes no responsibility for them.
Reply to: