Subject: Re: bug#21159: Fails To Match Empty String

From: Paul Eggert <[email-masked]>
Date: Wed, 29 Jul 2015 17:53:32 -0700

Squirrely wrote:
> bash$ rm empty
>>bash$ touch empty
>>bash$ # I am expecting a match, so grep should return 0.
>>bash$ grep '^$' empty
>>bash$ echo $?

Grep looks for lines that contain matches.  An empty file has no lines, so it 
cannot possibly contain any matches for any regular expression.