bug-coreutils
[Top][All Lists]
Advanced

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

Sort bug


From: linux-os \(Dick Johnson\)
Subject: Sort bug
Date: Wed, 21 Dec 2005 13:27:02 -0500



I sorted the following text.

static const char sh[]="SH";
static const char se[]="SE";
static const char _a[]="A";
static const char _r[]="R";
static const char _c[]="C";
static const char _d[]="D";
static const char _e[]="E";
static const char _f[]="F";
static const char _i[]="I";
static const char _w[]="W";
static const char _b[]="B";
static const char _s[]="S";
static const char _t[]="T";
static const char _m[]="M";
static const char _u[]="U";
static const char po[]="PO";
static const char pa[]="PA";
static const char ac[]="AC";
static const char cr[]="CR";
static const char da[]="DA";
static const char io[]="IO";
static const char ne[]="NE";
static const char tr[]="TR";
static const char in[]="IN";
static const char ip[]="IP";
static const char br[]="BR";
static const char de[]="DE";
static const char das[]="DAS ";
static const char acq[]="acquisition in ";

It resulted in this:

static const char _a[]="A";
static const char ac[]="AC";
static const char acq[]="acquisition in ";
static const char _b[]="B";
static const char br[]="BR";
static const char _c[]="C";
static const char cr[]="CR";
static const char da[]="DA";
static const char das[]="DAS ";
static const char _d[]="D";
static const char de[]="DE";
static const char _e[]="E";
static const char _f[]="F";
static const char _i[]="I";
static const char in[]="IN";
static const char io[]="IO";
static const char ip[]="IP";
static const char _m[]="M";
static const char ne[]="NE";
static const char pa[]="PA";
static const char po[]="PO";
static const char _r[]="R";
static const char se[]="SE";
static const char sh[]="SH";
static const char _s[]="S";
static const char tr[]="TR";
static const char _t[]="T";
static const char _u[]="U";
static const char _w[]="W";

Clearly it's not sorted.
Since "_" (0x5f) is lower in value than 'a' (0x61), clearly
the sorted list should have all the names beginning with
the underscore first!

I tried all the sort switches shown in `man sort` and nothing
fixed this problem. So, clearly sort has been broken. I tried
the same command on my Sun and it sorts as expected. Also, the
command-line sort with WIN-2000/Professional sorts as expected
as does DOS Version 6.22 sort.

So, either sort is broken or you have redefined what sort means.

sort (coreutils) 5.2.1
Written by Mike Haertel and Paul Eggert.


Cheers,
Dick Johnson
Penguin : Linux version 2.6.13.4 on an i686 machine (5589.55 BogoMips).
Warning : 98.36% of all statistics are fiction.
.

****************************************************************
The information transmitted in this message is confidential and may be 
privileged.  Any review, retransmission, dissemination, or other use of this 
information by persons or entities other than the intended recipient is 
prohibited.  If you are not the intended recipient, please notify Analogic 
Corporation immediately - by replying to this message or by sending an email to 
address@hidden - and destroy all copies of this information, including any 
attachments, without reading or disclosing them.

Thank you.




reply via email to

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