bug/inconsistancy in *grep

Henry Spencer henry at utzoo.UUCP
Sat Feb 11 08:14:58 AEST 1984


Tim Pointing complains:

  There is an inconsistancy in the way "-v" is handled in the V7 grep's
  (fgrep/egrep/grep). The "-v" flag should, in my humble opinion, invert
  the exit status of grep. I.e. if every line does contain the pattern
  (grep -v doesn't pass any lines to stdout), then the exit status of grep
  should indicate failure. If "grep" fails then "grep -v" shouldn't fail!.

Are you looking at the code or the documentation?  The behavior that you
seek is exactly the way egrep, grep, and fgrep really do behave on our
system, which is essentially vanilla V7.  The original Bell manual page
botched the description of this, but the programs do things right.
-- 
				Henry Spencer @ U of Toronto Zoology
				{allegra,ihnp4,linus,decvax}!utzoo!henry



More information about the Net.bugs.v7 mailing list