[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
head -1 fails with _POSIX2_VERSION=200112
From: |
Vincent Lefevre |
Subject: |
head -1 fails with _POSIX2_VERSION=200112 |
Date: |
Tue, 20 Sep 2005 13:50:51 +0200 |
User-agent: |
Mutt/1.5.10-vl-20050905i |
dixsept:~> _POSIX2_VERSION=200111 head -1 /dev/null
dixsept:~> _POSIX2_VERSION=200112 head -1 /dev/null
head: `-1' option is obsolete; use `-n 1'
Try `head --help' for more information.
zsh: exit 1 _POSIX2_VERSION=200112 head -1 /dev/null
I do not think this is a good idea to fail on the old form, as
it is still useful, at least with an interactive shell. As said
by the POSIX FAQ Q15, POSIX does not disallow this form:
http://www.opengroup.org/austin/papers/posix_faq.html
Q15. Does removal of obsolescent utility syntax mean that
implementations supporting usages of head -5 file,
tail -5 file, tail -l file are no longer allowed?
No, in general the intent of removing the obsolescent forms of
the utility synopses was not to disallow them to be supported
by implementations but to downgrade the status of their use in
applications from conforming application using an obsolescent
feature to non-conforming application. In general it is allowed
for utilities to have extensions that violate the utility syntax
guidelines so long as the forms defined in the standard that are
required to follow the utility syntax guidelines do so. The cases
cited fit the case. The Austin Group has more general cases under
review at the present time.
I would not be against an environment variable to restrict to POSIX
options only (for testing purpose and things like that), but in this
case, the coreutils should be consistent and disallow the -c option
too, as it is not described by POSIX:
http://www.opengroup.org/onlinepubs/009695399/utilities/head.html
(see the rationale).
--
Vincent Lefèvre <address@hidden> - Web: <http://www.vinc17.org/>
100% accessible validated (X)HTML - Blog: <http://www.vinc17.org/blog/>
Work: CR INRIA - computer arithmetic / SPACES project at LORIA
- head -1 fails with _POSIX2_VERSION=200112,
Vincent Lefevre <=