Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Posting-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: utzoo!henry
From: henry@utzoo.UUCP (Henry Spencer)
Newsgroups: net.unix-wizards,net.bugs.v7
Subject: Re: bug/inconsistancy in *grep
Message-ID: <3535@utzoo.UUCP>
Date: Fri, 10-Feb-84 17:14:58 EST
Article-I.D.: utzoo.3535
Posted: Fri Feb 10 17:14:58 1984
Date-Received: Fri, 10-Feb-84 17:14:58 EST
References: <692@dciem.UUCP>
Organization: U of Toronto Zoology
Lines: 15

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