bug#21159: Fails To Match Empty String

2015-07-29 Thread Squirrely
Hi I'm a bit of a regular expression noob, so I'm not sure if this is a bug or if I'm just missing something about how grep works. Here's a demo of the issue I have encountered: > bash$ rm empty > bash$ touch empty > bash$ # I am expecting a match, so grep should return 0. > bash$ grep '^$' empt

bug#21159: Fails To Match Empty String

2015-07-29 Thread Paul Eggert
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.