Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: POSIX conformance in coreutils



On Wed, Jan 12, 2005 at 10:27:01AM +0000, Peter Stephenson wrote:
> Vin Shelton wrote:
> > GNU coreutils (at least versions 5.2.1 and 5.3.0) enforce POSIX
> > conformance, so they don't like 'tail -1', instead they require
> > 'tail -n 1'.
> 
> Might the environment variable POSIXLY_CORRECT be set?  That seems to be
> the effect here.  We could unset it explicitly if that's the case.
[...]

As Vin said, it's more about the _POSIX2_VERSION env variable and
the default value (defined at compile time of it).

_POSIX2_VERSION=199209 tail -1

should be OK, whatever the value of POSIXLY_CORRECT for
coreutils 5.2.1 at least.

(unset POSIXLY_CORRECT; _POSIX2_VERSION=200112 tail -1)
tail: `-1' option is obsolete; use `-n 1'
Try `tail --help' for more information.


But I seem to remember there was also a warning message in some
other version, and it may not have been triggered by the same
envvar values... sigh.

-- 
Stéphane



Messages sorted by: Reverse Date, Date, Thread, Author