On Fri, 12 May 2000, J. Lasser wrote:
> The command `cat /etc/passwd [ or anything else ] | head -7` works fine.
> It works fine with head -8, head -9, and head -10.
>
> It works fine with head -01, -02, -03, -04, and so on. But head -08 and
> head -09 produce errors of the following sort:
>
> [jon@dood home]$ head -08
> head: 08: number of lines is so large that it is not representable
> [jon@dood home]$
This appears to be a bug in head; it should not interpret the number given
as octal, and the message given for what in this case is an invalid octal
number is misleading.
POSIX.2 subclause 2.10.1(6) specifies that, unless otherwise specified,
numeric operands and option-arguments are to be interpreted as decimal
integers; the inclusion of 0 there would seem to imply that the C Standard
definition of decimals should not be applied here. The definition of head
(4.29.3) states that the numeric argument shall be a positive decimal
integer. So I believe that head -010 should produce 10 (as on Solaris
2.6, for example) rather than 8 (as with GNU textutils 2.0) lines, in the
absence of an official POSIX.2 interpretation saying otherwise. (However,
arithmetic expressions in the shell should interpret values beginning with
0 as octal; there seems to be a recent interpretation, number 173,
confirming this
<URL:http://www.pasc.org/interps/unofficial/db/p1003.2/pasc-1003.2-173.html>.)
--
Joseph S. Myers
[EMAIL PROTECTED]