bug-gnu-utils
[Top][All Lists]
Advanced

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

Re: Simple feature request for grep


From: John.Cowan
Subject: Re: Simple feature request for grep
Date: Tue, 12 Jul 2005 10:27:08 -0400
User-agent: Mutt/1.4.2.1i

Bruno Haible scripsit:

> The problem also exists when the -r option is not specified. But in
> that case, grep cannot print a warning to stderr since it is common
> use of grep to read its input from stdin.

Granted, but if the -r is present, then the user has specified something
self-contradictory: recursive descent into directory arguments which are
not specified.  If we must allow "grep -r" and "grep -r -" command lines
for POSIX correctness, at least they should trigger a warning.

(IMAO, the whole behavior of Unix utilities when handed zero arguments is
badly thought out, as opposed to the fairly careful handling of zero-length
files.  For example, "rm" should silently do nothing, not spew a usage
message, and "cat" (as distinct from "cat -") should terminate immediately.
But it's decades too late to change any of this behavior.)

-- 
John Cowan  address@hidden  www.reutershealth.com  www.ccil.org/~cowan
Big as a house, much bigger than a house, it looked to [Sam], a grey-clad
moving hill.  Fear and wonder, maybe, enlarged him in the hobbit's eyes,
but the Mumak of Harad was indeed a beast of vast bulk, and the like of him
does not walk now in Middle-earth; his kin that live still in latter days are
but memories of his girth and his majesty.  --"Of Herbs and Stewed Rabbit"




reply via email to

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