[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#41700: grep -v always exiting with 1 for empty file
From: |
Andi Kleen |
Subject: |
bug#41700: grep -v always exiting with 1 for empty file |
Date: |
Thu, 4 Jun 2020 12:30:02 -0700 |
User-agent: |
NeoMutt/20170113 (1.7.2) |
On Thu, Jun 04, 2020 at 12:19:14PM -0700, Paul Eggert wrote:
> On 6/4/20 7:06 AM, Andi Kleen wrote:
> > I would argue that a empty file has a single empty line.
>
> No, an empty file has no lines. A single empty line would be a file of size 1,
> containing just a newline byte.
Just out of curiosity, in your definition would
echo -n foo > file
(so no newline, but non zero length)
have one or zero lines?
>
> > Besides it completely breaks the "is foo not in file" functionality.
>
> That's not what -v is for. -v asks "is not-FOO in file". If you want "is FOO
> not
> in file", use -L.
Ok.
-Andi
- bug#41700: grep -v always exiting with 1 for empty file, Andi Kleen, 2020/06/04
- bug#41700: grep -v always exiting with 1 for empty file, Paul Jackson, 2020/06/04
- bug#41700: grep -v always exiting with 1 for empty file, Norihiro Tanaka, 2020/06/04
- bug#41700: grep -v always exiting with 1 for empty file, Andi Kleen, 2020/06/04
- bug#41700: grep -v always exiting with 1 for empty file, Paul Eggert, 2020/06/04
- bug#41700: grep -v always exiting with 1 for empty file,
Andi Kleen <=
- bug#41700: grep -v always exiting with 1 for empty file, Eric Blake, 2020/06/04
- bug#41700: grep -v always exiting with 1 for empty file, Paul Eggert, 2020/06/04
- bug#41700: grep -v always exiting with 1 for empty file, Eric Blake, 2020/06/04
- bug#41700: grep -v always exiting with 1 for empty file, Paul Eggert, 2020/06/04