On 2/23/11, Eric Blake <[email protected]> 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?
