[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Possible bug in sort -V
From: |
Andreas Schwab |
Subject: |
Re: Possible bug in sort -V |
Date: |
Wed, 16 Dec 2009 11:36:36 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.1.90 (gnu/linux) |
Steve Ward <address@hidden> writes:
> On Tue, Dec 15, 2009 at 20:18, john blair <address@hidden>wrote:
>
>> cat a | /build/toolchain/lin32/coreutils-8.2/bin/sort -V
>> kernel-2.6.18-164.2.1.el5.x86_64.rpm
>> kernel-2.6.18-164.6.1.el5.x86_64.rpm
>> kernel-2.6.18-164.el5.x86_64.rpm
>>
>> The result should be
>> kernel-2.6.18-164.el5.x86_64.rpm
>> kernel-2.6.18-164.2.1.el5.x86_64.rpm
>> kernel-2.6.18-164.6.1.el5.x86_64.rpm
>>
>> Is it a bug is sort -V?
>>
>>
>>
>>
>>
>>
>>
>>
> What version of sort are you using?
> (sort --version)
>
> What is your locale setting?
>
> In ASCII, decimal digits are before alphabetical letters. Why did you
> expect the 'e' to come before '2' and '6'?
The version compare rules specify that numeric and non-numeric parts are
compared independently from left to right, and an empty part sorts
before any non-empty part (except tilde in a non-numeric part), thus
"kernel-2.6.18-164." sorts before "kernel-2.6.18-164.2".
Andreas.
--
Andreas Schwab, address@hidden
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."