grep-devel
[Top][All Lists]
Advanced

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

Re: How to suppress the exit status 1 when nothing matches?


From: Paul Eggert
Subject: Re: How to suppress the exit status 1 when nothing matches?
Date: Sat, 18 Sep 2021 17:10:42 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0

On 9/18/21 10:32 AM, Peng Yu wrote:
Grep returns 1 when there is no match. How to suppress this exit
status, but still maintains the other exit status

grep foo bar
status=$?
test $status -ne 1 || status=0



reply via email to

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