Bug#410439: sort does not properly process the -M by_date flag

2007-02-28 Thread Roger Marquis
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.

Bug#410439: sort does not properly process the -M by_date flag

2007-02-16 Thread Bob Proulx
Roger Marquis wrote: 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. POSIX requires that sort respect the

Bug#410439: sort does not properly process the -M by_date flag

2007-02-13 Thread Roger Marquis
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

Bug#410439: sort does not properly process the -M by_date flag

2007-02-12 Thread Roger Marquis
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

Bug#410439: sort does not properly process the -M by_date flag

2007-02-12 Thread Michael Stone
On Mon, Feb 12, 2007 at 09:53:24AM -0800, Roger Marquis wrote: I could not find this explanation in previous emails. because the LC_COLLATE rules for the C locale don't ignore whitespace, so you're effectively sorting on initial month and then sorting all 1 digit dates followed by all

Bug#410439: sort does not properly process the -M by_date flag

2007-02-11 Thread Michael Stone
On Sat, Feb 10, 2007 at 07:05:41PM -0800, Roger Marquis wrote: Not sure why sort -M would differ between C and UTF8 but if Well, I went over it in my email. Solaris should behave the same way, given equivalent locale-specific sorting rules. (Note that the solaris man page also defines -M as

Bug#410439: sort does not properly process the -M by_date flag

2007-02-10 Thread Roger Marquis
Package: coreutils Version: sort (GNU coreutils) 5.97 Severity: important Months are correctly parsed but days are not, with 10 listed ahead of 1-9... Could be a whitespace issue. Input format from /var/log i.e, syslogd output. Also, the -u or unique flag is wholly broken when used with -M.

Bug#410439: sort does not properly process the -M by_date flag

2007-02-10 Thread Michael Stone
severity 410439 normal quit On Sat, Feb 10, 2007 at 09:24:36AM -0800, you wrote: Severity: important No, it's not. It's normal at best. Please *do not* overinflate bug severities. It *will not* cause the bug to get more attention, but it will tend to cause actual important bugs to be lost

Bug#410439: sort does not properly process the -M by_date flag

2007-02-10 Thread Roger Marquis
No, it's not. It's normal at best. Please *do not* overinflate bug severities. It *will not* cause the bug to get more attention, but it will tend to cause actual important bugs to be lost in the noise. Don't know what you use sort for Mike but it is critial to server monitoring tools that

Bug#410439: sort does not properly process the -M by_date flag

2007-02-10 Thread Michael Stone
On Sat, Feb 10, 2007 at 10:58:49AM -0800, you wrote: Don't know what you use sort for Mike but it is critial to server monitoring tools that parse system logfiles. If it's so critical, why are you just learning about it now? Anyway, for myself, I keep my logs in ISO date format, which is much

Bug#410439: sort does not properly process the -M by_date flag

2007-02-10 Thread Roger Marquis
Don't know what you use sort for Mike but it is critial to server monitoring tools that parse system logfiles. If it's so critical, why are you just learning about it now? Good question. The only answer is that 'sort -M' works as expected on the other platforms where we use it, including

Bug#410439: sort does not properly process the -M by_date flag

2007-02-10 Thread Michael Stone
On Sat, Feb 10, 2007 at 12:30:11PM -0800, Roger Marquis wrote: Good question. The only answer is that 'sort -M' works as expected on the other platforms where we use it, including earlier versions of gnu coreutils. It doesn't seem to work the way you seem to expect it to, anywhere I tested

Bug#410439: sort does not properly process the -M by_date flag

2007-02-10 Thread Jim Meyering
Roger Marquis [EMAIL PROTECTED] wrote: Version: sort (GNU coreutils) 5.97 Months are correctly parsed but days are not, with 10 listed ahead of 1-9... Could be a whitespace issue. Input format from /var/log i.e, syslogd output. Also, the -u or unique flag is wholly broken when used with

Bug#410439: sort does not properly process the -M by_date flag

2007-02-10 Thread Roger Marquis
It doesn't seem to work the way you seem to expect it to, anywhere I tested it (including previous versions of coreutils--tested on 5.2.1). Maybe it works that way on solaris? sort -u -k 1,1M -k 2,2n -k 3 Yep, Solaris, xBSD. -M has meant by_date as long as I've been using it (1997).

Bug#410439: sort does not properly process the -M by_date flag

2007-02-10 Thread Michael Stone
On Sat, Feb 10, 2007 at 02:23:25PM -0800, Roger Marquis wrote: Yep, Solaris, xBSD. -M has meant by_date as long as I've been using it (1997). Well, you need to be a little more specific when you talk about xBSD. I checked OpenBSD when I first looked at your report, and it doesn't recognize

Bug#410439: sort does not properly process the -M by_date flag

2007-02-10 Thread Roger Marquis
And, of course, just after I sent that I realized that sorting by month is inherently locale-dependent (because the month names are localized). So you really need to make sure that the sort locale matches the language of the log files, and if both are C the relevance of which syntax is used is

Bug#410439: sort does not properly process the -M by_date flag

2007-02-10 Thread Roger Marquis
Thanks, this was the key. Sorting by date doesn't seem to be possible without setting LC_ALL=C. The sticking point seems to be the minute field. Small correction, setting LC_ALL is not always required in order to use sort's -M with syslog datestamps, but it is when LANG is both defined and

Bug#410439: sort does not properly process the -M by_date flag

2007-02-10 Thread Michael Stone
On Sat, Feb 10, 2007 at 08:52:43PM -0500, Michael Stone wrote: (month) key. 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 And, of course, just after I sent that I realized that sorting by month is