|
From: | Paul Eggert |
Subject: | bug#21159: Fails To Match Empty String |
Date: | Wed, 29 Jul 2015 17:53:32 -0700 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.8.0 |
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.
[Prev in Thread] | Current Thread | [Next in Thread] |