Squirrely wrote:
bash$ rm emptybash$ 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.