bug-grep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#63819: Gnu `grep '.*'` does not match an empty string.


From: Paul Eggert
Subject: bug#63819: Gnu `grep '.*'` does not match an empty string.
Date: Wed, 31 May 2023 17:42:47 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0

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






reply via email to

[Prev in Thread] Current Thread [Next in Thread]