Red Hat Bugzilla – Bug 555971
_POSIX2_VERSION removed from info
Last modified: 2010-01-18 17:31:11 EST
Description of problem:
Despite the continued existence of the _POSIX2_VERSION environment variable to allow use of +N[.M][flag] options the documentation for it has been removed from info file. Features which are implemented should be properly documented. A habit of implementing features without documenting them should be discouraged.
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1. _POSIX2_VERSION=199209 sort +0.1 /etc/passwd
2. "info sort" and search for _POSIX2_VERSION
1. Works as expected
2. nothing found
1. Work as expected
2. info should still contain the information about _POSIX2_VERSION that it used to have.
I have to say that the sort syntax and combinations of flags are almost completely illogical. For example, you cannot mix -b/-n flags and key-specific flags and get consistent results. You can with the +N[.M][flag] options.
Also, if you run sort without -t flag and with key positions without -b modifier you don't get sensible or predictable results. Naturally all of this should be the subject of another bug report, but while _POSIX2_VERSION still exists then one can use the old +N[.M][flag] style options and get perfect results all of the time. Why some clever person didn't just swap the '+' as in +N[.M][flag] with a '-' instead of inventing an inferior system of malfunctioning -k options nobody knows.
AFAIK coreutils-7.6 (which is in F-12) info documentation still does contain information about _POSIX2_VERSION - you could check this at upstream version of coreutils.texi sourcefile at http://git.savannah.gnu.org/cgit/coreutils.git/tree/doc/coreutils.texi?id=aa2f797c7d2a5ccc7f9ceacbe857dd8d621bef35 , line 1408. So maybe just some reference was removed/changed between releases. I'll check it on Monday. You could call sort syntax and combinations of flags almost completely illogical, but most of them are required by POSIX ( https://www.opengroup.org/onlinepubs/009695399/utilities/sort.html ) - and coreutils have to follow those rules/syntax. If you have some particular cases of inconsistent results, please be specific - otherwise we (or upstream) have no chance to address those issues.
So ... F-12 info documentation has following:
$ info coreutils 'sort invocation' :
"On older systems, `sort' supports an obsolete origin-zero syntax
`+POS1 [-POS2]' for specifying sort keys. This obsolete behavior can
be enabled or disabled with the `_POSIX2_VERSION' environment variable
(*note Standards conformance::); it can also be enabled when
`POSIXLY_CORRECT' is not set by using the obsolete syntax with `-POS2'
$ info coreutils 'Standards conformance' :
" The GNU utilities normally conform to the version of POSIX that is
standard for your system. To cause them to conform to a different
version of POSIX, define the `_POSIX2_VERSION' environment variable to
a value of the form YYYYMM specifying the year and month the standard
was adopted. Two values are currently supported for `_POSIX2_VERSION':
`199209' stands for POSIX 1003.2-1992, and `200112' stands for POSIX
1003.1-2001. For example, if you have a newer system but are running
software that assumes an older version of POSIX and uses `sort +1' or
`tail +10', you can work around any compatibility problems by setting
`_POSIX2_VERSION=199209' in your environment."
IMHO sufficient - so closing WORKSFORME/NOTABUG.
Looks like upgraded coreutils (7.6-8) has restored the missing information.