GNU bug report logs - #41700
grep -v always exiting with 1 for empty file

Previous Next

Package: grep;

Reported by: Andi Kleen <andi <at> firstfloor.org>

Date: Thu, 4 Jun 2020 04:33:01 UTC

Severity: normal

Tags: notabug

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

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Eric Blake <eblake <at> redhat.com>, Andi Kleen <andi <at> firstfloor.org>
Cc: 41700 <at> debbugs.gnu.org
Subject: bug#41700: grep -v always exiting with 1 for empty file
Date: Thu, 4 Jun 2020 13:42:12 -0700
On 6/4/20 1:34 PM, Eric Blake wrote:
>>> in your definition would
>>>
>>> echo -n foo > file
>>>
>>> (so no newline, but non zero length)
>>
>> No, the file has zero length:
>>
>> $ echo -n >file
> 
> You missed the 'echo -n foo' that prints 3 bytes to file.

Ah sorry, indeed I did. In that case my interpretation indeed agrees with yours.




This bug report was last modified 4 years and 239 days ago.

Previous Next


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