GNU bug report logs - #78891
Option to make grep always exit with 0

Previous Next

Package: grep;

Reported by: Thomas Güttler Mailinglisten <guettliml <at> gmail.com>

Date: Tue, 24 Jun 2025 14:36:04 UTC

Severity: normal

Full log


View this message in rfc822 format

From: Thomas Güttler Mailinglisten <guettliml <at> gmail.com>
To: 78891 <at> debbugs.gnu.org
Subject: bug#78891: Option to make grep always exit with 0
Date: Tue, 24 Jun 2025 11:49:21 +0200
[Message part 1 (text/plain, inline)]
Hi,

after trying several tools like SaltStack and Ansible and several CI tools,
I came
to the conclusion that a Bash script is often the most convenient and
powerful solution.

To make Bash more robust, I use the "strict mode".

This works fine, except that very often I want to filter out some output,
and it
does not matter to me if there is a match or not.

Afaik there is no option to make `grep` always exit with a zero exit
status. No matter if a match was found or not. Errors like "file not found"
should still return a non-zero exit status.

Just out of curiosity, would you accept a patch to implement that?

Which command line argument could be used for that option?

Regard,
  Thomas Güttler
[Message part 2 (text/html, inline)]

This bug report was last modified 50 days ago.

Previous Next


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