GNU bug report logs - #21159
Fails To Match Empty String

Previous Next

Package: grep;

Reported by: Squirrely <squirrely <at> gmx.com>

Date: Wed, 29 Jul 2015 22:51:02 UTC

Severity: normal

Done: Paul Eggert <eggert <at> cs.ucla.edu>

Bug is archived. No further changes may be made.

Full log


Message #10 received at 21159-done <at> debbugs.gnu.org (full text, mbox):

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Squirrely <squirrely <at> gmx.com>, 21159-done <at> debbugs.gnu.org
Subject: Re: bug#21159: Fails To Match Empty String
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.





This bug report was last modified 9 years and 360 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.