[Top][All Lists]

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

Re: Grep --directories option

From: Patrick Strasser
Subject: Re: Grep --directories option
Date: Sat, 31 May 2003 02:06:50 +0200
User-agent: Internet Messaging Program (IMP) 4.0-cvs

Quoting Jeff Bailey <>:

> On Fri, May 30, 2003 at 01:58:14PM -0700, Paul Eggert wrote:
> > This is simple and portable, and it's more useful than the current
> > behavior.  The new behavior would conform to POSIX, since POSIX
> > requires that the input files must be text files; directories are not
> > text files, so GNU grep can do what it likes with them.
> I don't have my copy of Posix handy - Is there a rule saying that
> directories cannot be textfiles?  It's certainly reasonable in the Hurd
> that they might be both.

If I understand diretory semantics in the Hurd right, the directory is meant
as directory only with a trailing slash, and as file if only called with
the name without slash.

So `grep foo bar/` would search for files with contents foo in the directory
bar, and `grep foo bar` would search for files with parts of their names
containig foo. So --directory would be not significant, at least not for
first order. Greping directories as files would then be of course not

Please correct me if I'm wrong; mayby I'm completely mistaken and mix things

Engineers motto: cheap, good, fast: choose any two
Patrick Strasser <past at sbox dot tugraz dot at>
Student of Telematik, Techn. University Graz, Austria

reply via email to

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