Re: Head -n argument position matters

Jim Meyering <[email protected]>
Newsgroups gmane.comp.gnu.textutils.bugs
Message-ID <[email protected]>
Edward Avis <[email protected]> wrote:
> On Sat, 20 Apr 2002, Jim Meyering wrote:
>
>>That's the expected behavior, because options like `-1'
>>are obsolete.
>
>>  $ env _POSIX2_VERSION=200112 head -1
>>  head: `-1' option is obsolete; use `-n 1'
>
> Yikes!  There sure are some crazy things going on in Posixland...
>
> But surely in the current version of head, if -1 is accepted at the
> start it should be accepted at the end too - for consistency with other
> options.

Sorry, but this isn't anything new.
Even 10 years ago, POSIX called options like `-1' (and `-666' :-)
obsolescent, and tools like getopt don't treat them the same
way as regular options.

Actually, it's all in the interests of consistency: for example,
options like comm's -1, -2, and -3 are ok, but options like
head's -N (where N is a positive integer) are not.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.