GNU bug report logs - #16329
`head --lines=-0' prints nothing if no newline at the EOF

Previous Next

Package: coreutils;

Reported by: Алексей Шилин <rootlexx <at> mail.ru>

Date: Fri, 3 Jan 2014 16:31:01 UTC

Severity: normal

Merged with 16559, 16560, 16561

Done: Pádraig Brady <P <at> draigBrady.com>

Bug is archived. No further changes may be made.

Full log


Message #20 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: bug-coreutils <at> gnu.org
Subject: Re: bug#16329: `head --lines=-0' prints nothing if no newline at
 the EOF
Date: Fri, 03 Jan 2014 09:34:28 -0800
Pádraig Brady wrote:
> It states that text files can have zero or more lines,
> implying that the trailing new line is optional.

I think Eric's right here; if the file is nonempty,
a trailing newline is required.

I'm old enough to remember when text files were not
allowed to be empty (!).  Totally bizarre, but that's
the way POSIX was until 2008.  Before that, every text
file had to end with a newline byte.  See:

http://pubs.opengroup.org/onlinepubs/000095399/basedefs/xbd_chap03.html#tag_03_392




This bug report was last modified 11 years and 118 days ago.

Previous Next


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