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

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

Re: grep -v exit status constantly zero


From: Paul Jarc
Subject: Re: grep -v exit status constantly zero
Date: Tue, 16 Sep 2008 00:58:34 -0400
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1 (gnu/linux)

Harri Järvi <address@hidden> wrote:
> In practice the exit value seems to be 0 (zero) in every case with the
> "-v" option.

The 2.5.3 info documentation says:
# Normally, the exit status is 0 if selected lines are found and 1
# otherwise.

With -v, non-matching lines are selected for output.  If there are no
selected lines (with -v, this means that all input lines match the
regexp), then the status is 1.

$ echo foo | grep -v foo; echo $?
1


paul




reply via email to

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