GNU bug report logs - #74699
need valid explanation / weird 'grep -q' behaviour

Previous Next

Package: grep;

Reported by: Frank Reppin <frank <at> undermydesk.org>

Date: Thu, 5 Dec 2024 04:39:01 UTC

Severity: normal

Tags: notabug

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

Bug is archived. No further changes may be made.

Full log


Message #8 received at 74699 <at> debbugs.gnu.org (full text, mbox):

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Frank Reppin <frank <at> undermydesk.org>
Cc: 74699 <at> debbugs.gnu.org
Subject: Re: bug#74699: need valid explanation / weird 'grep -q' behaviour
Date: Thu, 5 Dec 2024 11:59:20 -0800
On 2024-12-04 15:43, Frank Reppin wrote:
> Some claim that this is due to 'set -o pipefail' beeing used in the 
> script... but this does not really explain why it only _sometimes_ happens.

I don't see why not. Pipe buffering is an "it all depends" situation.

Anyway, I tried your script on bleeding-edge grep on Fedora 40 and it 
worked fine for me. You didn't mention your grep version; behavior in 
this area changed in 2016, though I doubt your version is that old.

One workaround is to use "set -o pipefail" only for pipelines where you 
want the entire pipeline to fail merely because one component failed.




This bug report was last modified 217 days ago.

Previous Next


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