GNU bug report logs - #63819
Gnu `grep '.*'` does not match an empty string.

Previous Next

Package: grep;

Reported by: "Bob Vincent Il (US)" <robert.a.vincent.ii <at> pwc.com>

Date: Wed, 31 May 2023 23:02:02 UTC

Severity: normal

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

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: "Bob Vincent Il (US)" <robert.a.vincent.ii <at> pwc.com>
Cc: 63819 <at> debbugs.gnu.org
Subject: bug#63819: Gnu `grep '.*'` does not match an empty string.
Date: Wed, 31 May 2023 17:42:47 -0700
On 2023-05-31 10:18, Bob Vincent Il (US) via Bug reports for GNU grep wrote:
> I discovered only today that the following commands all behave identically:
> 
>    *   grep -q '.*'
>    *   grep -q '.\+'
>    *   grep -q .
>    *   grep -qE '.*'
>    *   grep -qE '.+'
>    *   grep -qE .

No they don't. For example:

$ echo '' | grep -q . ; echo $?
1
$ echo '' | grep -q '.*' ; echo $?
0





This bug report was last modified 2 years and 50 days ago.

Previous Next


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