|
From: | Paul Eggert |
Subject: | bug#16329: `head --lines=-0' prints nothing if no newline at the EOF |
Date: | Fri, 03 Jan 2014 09:34:28 -0800 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.2.0 |
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
[Prev in Thread] | Current Thread | [Next in Thread] |