because the LC_COLLATE rules for the C locale don't ignore
whitespace

I could find nothing in the POSIX Locale spec that requires every
flag of a command to ignore whitespace. Such a requirement would
be ridiculous on its face.

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.

Your opinion, probably motivated by the desire avoid fixing a bug.
Sort's -M flag was designed to sort the syslog date field, and
ignore whitespace, and there is no Unicode requirement that
conflicts with that design.

This is not an issue, however, because Solaris does not set the
default LANG to UTF-8
Neither does debian, that's an install-time choice. (Solaris has
the same kind of install-time locale selection.)

I can't recall changing this default during installation. What
should /etc/environment have set LANG to?

Again, I think I already explained why it would behave that way
in the C locale. I also pointed out that -M is documented as
sorting by month and does not say anything about dates.

According to this logic every documentation bug should be fixed by
changing the code.

The syntax I described before (sort -k 1,1M -k 2,2n -k 3) will
be more reliable because it will work regardless of the
current locale settings

It is reliable but not accurate. "-k 3" stops sorting at the
first ":" in the hour:minute:second field.

I can't duplicate that:

Doesn't work in reverse i.e, "-k1Mr -k2nr -k3nr" ... another bug.

For clarification, are you saying that the output of "-M"
should differ between LANG=C and LANG=UTF-8 even though the
input fields are identical?

Yes, as documented in both coreutils and solaris, -M is
locale-specific (different languages don't spell months the same
way) and basic sorting rules (specifically those dealing with
non-ascii and whitespace characters) are different.

In this context locale only requires that the non-english month
abbreviations be recognized correctly for the purposes of sorting
by date. It does not have anything to do with whitespace.

Roger Marquis


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

Reply via email to