[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
grep -v exit status constantly zero
From: |
Harri Järvi |
Subject: |
grep -v exit status constantly zero |
Date: |
Mon, 15 Sep 2008 12:27:05 +0300 |
User-agent: |
Mutt/1.5.13 (2006-08-11) |
GNU grep manual doesn't clearly state what the exit status will be
when used with the "-v" (--invert-match) option.
In practice the exit value seems to be 0 (zero) in every case with the
"-v" option.
Some versions of grep manual found on the web seems to clarify the exit
status used in this case. For example:
"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.)"
- http://leaf.dragonflybsd.org/cgi/web-man?section=1&command=grep
I think the manual should say how the -v option affects the exit status.
Also I think the exit status should reflect wether there was a match or
not, and not be constantly zero.
Yours,
Harri
- grep -v exit status constantly zero,
Harri Järvi <=