On Mon, Apr 7, 2008 at 11:04 AM, Sridhar Ayengar <ploopster at gmail.com> wrote:
John Floren wrote:
Complaints about how Unix is "silent"
when there is no output--"grep"
returning nothing instead of saying "No matches" when there aren't any
matches--these are basically invalid. They're the kind of thing people
who don't use or understand pipes will say.
That's bull. There are ways to make grep output something like "No
matches" without breaking a pipeline that uses it. I suggest that perhaps
those who say "They're the kind of thing people who don't use or understand
pipes will say." are the ones who truly don't understand pipes.
Peace... Sridhar
No news is good news. Sure, you could make grep blather all over
stderr or something, but why? If you don't get any errors, the program
completed correctly. If you screwed up the syntax or specified a
nonexistent file, you get an error.
However, since GNU tools are so utterly goddamn broken, this may or
may not be the case on any given tool. Try Plan 9 some time and you'll
have a lovely experience... for example, see
http://plan9.bell-labs.com/magic/man2html/1/cat for the proper way to
implement cat.
John
--
Ph'nglui mglw'nafh Cthulhu R'lyeh wgah'nagl fhtagn