[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: grep: return code with -v and empty input
From: |
Edward Avis |
Subject: |
Re: grep: return code with -v and empty input |
Date: |
Sat, 24 Mar 2001 10:04:33 +0000 (GMT) |
On Fri, 23 Mar 2001, Alain Magloire wrote:
>>>According to the documentation, the -v flag is supposed to invert the
>>>exit status:
>>>
>>>>Normally, exit status is 0 if matches were found, and 1 if no matches
>>>>were found (the `-v' option inverts the sense of the exit status).
>grep.info and man page:
>Diagnostics
>***********
>
> Normally, exit status is 0 if selected lines are found and 1
>otherwise. But the exit status is 2 if an error occurred, unless the
>`-q' or `--quiet' or `--silent' option is used and a selected line is
>found.
>
>Is this not clear?
That's not quite the same as the info page for grep that I had. (Do you
mean this is the proposed new documentation?) But yes, it is clear.
The misleading sentence '-v inverts the exit status' was the problem I
think.
--
Ed Avis
address@hidden