coreutils
[Top][All Lists]
Advanced

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

Re: Is natural sort supported?


From: Peng Yu
Subject: Re: Is natural sort supported?
Date: Tue, 8 Oct 2019 02:18:09 -0500

Some part of the manual is also poorly written.

"1.1.2 Origin of version sort and differences from natural sort"

After reading the above section, I am still not clear what is the
difference. It is better to show some examples to illustrate the
difference.

On 10/8/19, Peng Yu <address@hidden> wrote:
> Then, the option name causes misunderstand. -V is actually
> --debian-version. And it is not natural order (there is no such thing
> like extension handling with natural order). The natural order is
> plain and simple, just as what is explained below, which can be
> implemented by a few lines of python code.
>
> https://blog.codinghorror.com/sorting-for-humans-natural-sort-order/
>
> So my question is whether natural order as in the above URL is supported?
>
> On 10/8/19, Assaf Gordon <address@hidden> wrote:
>> Hello,
>>
>> On 2019-10-08 12:36 a.m., Peng Yu wrote:
>>> The following example shows that version sort is not natural sort. Is
>>> natural sort supported in by `sort`?
>>
>> There is no such thing as "THE correct natural sort" order...
>>
>>> $ printf '%s\n' 1G13 1.02 | LC_ALL=C sort -k 1,1V # The result order
>>> should have been reversed.
>>
>> ... therefore "should have" is simply incorrect expectation.
>>
>> You might think it "should" be one way, and other implementations
>> think it "should" be another way.
>>
>> For more details, please see the attached HTML file for details.
>>
>> (this HTML file is a new chapter of the coreutils manual that will be
>> included in the next release. The source texinfo is here:
>> https://git.savannah.gnu.org/cgit/coreutils.git/tree/doc/sort-version.texi
>> ).
>>
>> regards,
>>   - assaf
>>
>>
>
>
> --
> Regards,
> Peng
>


-- 
Regards,
Peng



reply via email to

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