GNU bug report logs - #30105
Additional "grep" parameter to change the exit code from 1 to 0, even if grep doesn't find pattern

Previous Next

Package: grep;

Reported by: Vasyl Vavrychuk <vvavrychuk <at> gmail.com>

Date: Sun, 14 Jan 2018 05:57:02 UTC

Severity: normal

Done: Paul Eggert <eggert <at> cs.ucla.edu>

Bug is archived. No further changes may be made.

Full log


Message #13 received at 30105-done <at> debbugs.gnu.org (full text, mbox):

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Vasyl Vavrychuk <vvavrychuk <at> gmail.com>
Cc: 30105-done <at> debbugs.gnu.org
Subject: Re: bug#30105: Additional "grep" parameter to change the exit code
 from 1 to 0, even if grep doesn't find pattern
Date: Sun, 14 Jan 2018 09:16:41 -0800
Vasyl Vavrychuk wrote:
> Actually I use grep in pipe with
> 
>    set -eo pipefail
> 
> but still there I can do
> 
>    ... | grep exrp || test $? -lt 2 | ...
> 
> Thanks for suggestion.

You're welcome. You'll need to parenthesize of course. Closing the bug.




This bug report was last modified 7 years and 125 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.