bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#8102: [head] do not return EXIT_SUCCESS upon premature EOF


From: Bjartur Thorlacius
Subject: bug#8102: [head] do not return EXIT_SUCCESS upon premature EOF
Date: Fri, 25 Feb 2011 16:40:11 +0000

On 2/23/11, Eric Blake <address@hidden> wrote:
> On 02/23/2011 11:58 AM, Bjartur Thorlacius wrote:
> That's because this is not a bug, but a POSIX requirement:
>
> http://pubs.opengroup.org/onlinepubs/9699919799/utilities/head.html
>
> "When a file contains less than number lines, it shall be copied to
> standard output in its entirety. This shall not be an error."
>
Indeed. Since it's explicitly mentioned, I assume there's a reason for
it. I'd be grateful if someone could point out what the rationale beind
the decision is (or better yet, where such information can be found).

So should I be using a head-alike for iterating over lines, and would
such an utility belong to a GNU package, or is awk the right tool for the
job?





reply via email to

[Prev in Thread] Current Thread [Next in Thread]