bug-grep
[Top][All Lists]
Advanced

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

bug#30105: Additional "grep" parameter to change the exit code from 1 to


From: Paul Eggert
Subject: bug#30105: Additional "grep" parameter to change the exit code from 1 to 0, even if grep doesn't find pattern
Date: Sat, 13 Jan 2018 22:57:27 -0800
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0

Vasyl Vavrychuk wrote:
I would like to have an option to return success if nothing is found but
still return fail if error happens.

You can use a shell command like this:

grep PATTERN FILE
test $? -lt 2

I don't see the need for a special grep option to handle this problem.





reply via email to

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