grep is always recursive

Derek Broughton derek at pointerstop.ca
Wed Jan 28 03:15:00 UTC 2009


Hal Burgiss wrote:

> On Tue, Jan 27, 2009 at 09:49:22PM -0400, Derek Broughton wrote:
>> 
>> I don't consider it a bug at all, difficult as it is.  Who in their right
>> minds creates file names with anything but a leading alpha character? 
>> Sorry, but that's just asking for trouble.
> 
> GNU: Gnot for Use on directory structures containing files with leading
> non-alpha characters.

It's hardly fair to blame "Gnu" (or Linux, or *nix systems in general).  
It's possible to use practically anything for a file name.  otoh, it is not 
_practical_ to use anything possible for a filename.   Linux does a better 
job than some other OS's at handling non-alphas in filenames, but it still 
isn't smart to use them as the leading character.

>> That's just standard man page construction.  How else do you simply show
>> that options and other arguments can be interspersed?
> 
> Well, not by clearly stating that the order on the command line is
> signficant. Or is it significant in some cases, but not in others?
> I can't see how ...
> 
>       grep [OPTIONS] PATTERN [FILE...]
>       grep [OPTIONS] [-e PATTERN | -f FILE] [FILE...]
> 
> says anything other than OPTIONS come before PATTERN and FILEs come
> after. There clearly are ways to impart variable syntax.

Except that conventionally man pages do _exactly_ that - and yet options are 
not (normally) restricted to being before non-option arguments.  So your 
suggestion does not remove the problem.  You could use a BNF representation, 
but at the cost of making it significantly harder  to understand for most of 
the people who need the man page.







More information about the ubuntu-users mailing list