Mike Stone wrote:
Not sure why "sort -M" would differ between C and UTF8 but if

Well, I went over it in my email.

I could not find this explanation in previous emails. I can see
from the system logs that syslogd is honoring LANG="en_US.UTF-8"
from /etc/environment. And the datestamp does not differ from logs
created with LANG=C. That leaves only the sort command as the
source of the bug.

Solaris should behave the same way, given equivalent
locale-specific sorting rules.

'env LANG="en_US.UTF-8" sort -M' is also broken in Solaris 2.8.
This is not an issue, however, because Solaris does not set the
default LANG to UTF-8. Also, 'env LANG="en_US.UTF-8" sort -M'
does work as expected in FreeBSD.

(Note that the solaris man page also defines -M as "month sort"
and says nothing about days.)

Obviously a bug in the man page. "-M" has sorted by date,
including the day of the month and hour of the day, in pre-UTF
implementations going back decades.

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. The only way I've yet found to sort
on the entire datestamp, "Mmm DD HH:MM:SS", is with the "-M" flag.

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?

Roger Marquis


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

Reply via email to