POSIX requires that sort respect the values of LANG, LC_COLLATE and
LC_ALL to set the locale for ordering rules.
 http://www.opengroup.org/onlinepubs/009695399/utilities/sort.html

Thanks Bob, however, the only reference to all sort keys in this
document is in regards to modifiers like -r. Nothing that I
could see would mandate this behavior in -M.

The document has a single reference to -M, noting that it "was
omitted because of non-portability." By omission from the POSIX
spec you would think it should retain the historic behavior.

Section 8.2, on environment variables, covers LANG, LC_COLLATE and
LC_ALL but says, regarding LANG, "This can be used by applications to
determine the language to use for error messages and instructions,
collating sequences, date formats, and so on." Again, nothing that
might indicate why -M must or should not correctly parse syslog's
standard date format for C or UTF-8.

In practice both the tested locales result in identical date stamps.
The only difference between other locales would be the spelling of the
month.  So, I'm still looking for documentation which would require
LANG or LC* to break the traditional -M date sort flag.

Not broken, more working as designed (as is coreutils). Your
expectations may not match the behavior, but it is consistent
with the design (and documentation) of the sort command.

No disputing that, but given the POSIX documentation (referenced
above), it appears that coreutils are broken by design rather than by
POSIX.  Pre-POSIX, the -M flag sorted by syslog date format, not by
month.  I find it difficult to believe that coreutils design is
based on (flawed) documentation rather than source code.

You don't like it.  I don't like it.  I don't know of anyone who likes
it.  But just the same the powers-that-be have created the locale
collating sequences in such a way that whitespace and punctuation is
ignored and case is folded.  Personally I think they confused working
with data on a computer with writing text about working on a computer.

That is the question, don't like what?  The URLs you send didn't
clarify this question.


You probably need to set LC_ALL=C in your environment.

In Etch to be sure, but not in FreeBSD or Solaris 10, and I'm pretty
sure both of those non-Linux OS are also POSIX compliant.

Roger Marquis


--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to