[Top][All Lists]

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

bug#21159: Fails To Match Empty String

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 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.

reply via email to

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