bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Bug in Linux "sort" command??? (Red Hat V9)


From: Stuart Allsop
Subject: Bug in Linux "sort" command??? (Red Hat V9)
Date: Fri, 23 Apr 2004 04:26:10 -0400

The SORT command in Red Hat 9 doesn't seem to work as advertised. I'm
trying to use it to sort some mixed-up web logs by year, month and day.

I'm using this:

sort -f -s -d -M -k4.9,4.12n -k4.5,4.7M -k4.2,4.3n ./raw_log -o
./sorted_log

The web log record format is as follows:

236-56-50.dial.terra.cl - - [02/Feb/2004:00:01:48 +0000] "GET /
HTTP/1.1..."

In effect, I'm trying to sort on the 4th field, firstly by Year as a
number, then by Month as a month (the "-M" does that, supposedly), then
by Day as a number. Except that it doesn't work under Red Hat Linux 9.
The exact same command works just fine under another Unix (SGI Irix
6.5), and produces the expected result. But Red Hat 9 produces anything
BUT the desired result. To be honest, I can't quote figure out WHAT keys
it is actually sorting on!!!

Any ideas? Is "sort" known to be broken? Am I doing something wrong?

If it would help, I'd be happy to supply the test files that I'm using
to try to figure out the problem (the actual logs are pretty big, and
take ages to sort, so I created a brief version with around 30 records,
just to test).  

I've been battling with this for hours, and cannot get anything more
than a simple sort on one key to work.  Anything more complex seems to
confuse SORT, and it puts out garbage.


Sincerely,


Stuart D. Allsop




reply via email to

[Prev in Thread] Current Thread [Next in Thread]