bug-coreutils
[Top][All Lists]
Advanced

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

Re: Bug in sort v5.2.1


From: David Eisner
Subject: Re: Bug in sort v5.2.1
Date: Wed, 02 Jun 2004 13:32:43 -0400
User-agent: Mozilla Thunderbird 0.6 (Windows/20040502)

It's actually sorting correctly, if a period '.' comes after
letters of the alphabet.  In your example, 'b' precedes
'.', so ab.a is first.  And 'c' precedes 'z', so the rest is
correct.

We all agree 'a' comes before 'b', but does 'a' come
before '.' ?  This depends on the locale, and specifically
on LC_COLLATE.  For example:

---snip---
$ export LC_COLLATE=en_US 
$ sort sample
ab.a
a.c
a.z
$ export LC_COLLATE=C
$ sort sample
a.c
a.z
ab.a
---snip---


-David


Reg. Charney wrote:

>I believe that sort in coreutils v5.2.1 has a basic bug in it - it seems to 
>treat the period (.) as a non-existant character. Here is an example:
>
>$cat sample
>a.z
>ab.a
>a.c
>
>$sort sample
>ab.a
>a.c
>a.z
>
>This would be correct if we were to ignore the periods - the sort order would 
>be aba, ac, az. I believe the order should be a.c, a.z, ab.a
>
>Reg. Charney
>  
>





reply via email to

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