GNU bug report logs - #29613
Debian Bug#883733: grep returns 0 even if there is no match

Previous Next

Package: grep;

Reported by: "Santiago R.R." <santiagorr <at> riseup.net>

Date: Fri, 8 Dec 2017 11:12:02 UTC

Severity: normal

Full log


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

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: "Santiago R.R." <santiagorr <at> riseup.net>, 29613 <at> debbugs.gnu.org
Cc: 883733 <at> bugs.debian.org
Subject: Re: bug#29613: Debian Bug#883733: grep returns 0 even if there is no
 match
Date: Fri, 8 Dec 2017 10:34:53 -0800
On 12/08/2017 03:11 AM, Santiago R.R. wrote:
> $ echo 1111111111111 | grep -E '^(11+)\1+$|^1?$' ; echo $?
> 1111111111111
> 0
>
> Shouldn't the last grep command exit 1 too?

Yes it should. This appears to be due to a longstanding bug in the glibc 
regular expression matcher. See:

https://sourceware.org/bugzilla/show_bug.cgi?id=11053





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

Previous Next


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