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

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

Re: grep invert-match return code


From: Paul Jarc
Subject: Re: grep invert-match return code
Date: Thu, 20 Apr 2006 20:25:08 -0400
User-agent: Gnus/5.110003 (No Gnus v0.3) Emacs/21.4 (gnu/linux)

Tavis Ormandy <address@hidden> wrote:
> $ printf "one\ntwo\nthree\n" | grep -v four; echo $?
> one
> two
> three
> 0

This is correct.  -v doesn't just invert the output, it also inverts
"selection".  An exit status of 0 doesn't mean that an input line
matched the regexp; it means that an input line matched the
combination of the regexp and -v.


paul




reply via email to

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