On 2/15/14, Ray_Net <tbrraymond.schmit...@tbrscarlet.be> wrote:
> Paul B. Gallagher wrote, On 15/02/2014 01:28:
>> Ray_Net wrote:
>>> Paul B. Gallagher wrote, On 14/02/2014 18:49:
>>>> Ray_Net wrote:
>>>>> Paul B. Gallagher wrote, On 14/02/2014 15:45:
>>>>>> Rick Merrill wrote:
>>>>>>
>>>>>>> On 2/12/2014 1:07 PM, Paul B. Gallagher wrote:
>>>>>>>> Rick Merrill wrote:
>>>>>>>>
>>>>>>>>> "Version Numbers" always annoy me when 2.24 is greater than
>>>>>>>>> 2.80 !-)
>>>>>>>>
>>>>>>>> Where have you ever come across "SM 2.80"? Have you been using Dr.
>>>>>>>> Emmett Brown's specially configured DeLorean?
>>>>>>>>
>>>>>>>
>>>>>>> since when is 2.24 greater that 2.8?  (evening up the digits is an
>>>>>>> engineering thing)
>>>>>>
>>>>>> Well, now, I didn't ask about "2.8," now did I? I asked about "2.80."
>>>>>> And SM 2.80 is years in the future, and might not ever happen if
>>>>>> we go
>>>>>> to version 3.
>>>>>>
>>>>>> In the SeaMonkey world, where the dot is not a decimal point, "24"
>>>>>> has
>>>>>> always been greater than "8."
>>>>>>
>>>>> But "8." is greater than "24" :-)
>>>>
>>>> In what universe?
>>>>
>>> In any alphanumeric sort.
>>
>> Well, if you choose to alphabetize numbers, I guess you will get weird
>> results. Can't think why you'd want to, though.
>>
> I did not choose the way of the sort work. With "2.14.1" you CANNOT tell
> the sort that this STRING is a numeric one.

you can tell sort it's a version number: --version-sort or -V

$ cat sort-test
echo -e "2.19 \n2.8 \n2.24 \n2.9 \n2.10 \n2.3 \n2.8.1 \n2.9.1 " |\
sort -k 1,1V

$ sh sort-test
2.3
2.8
2.8.1
2.9
2.9.1
2.10
2.19
2.24

-V also does the right thing with ip addresses :)

$ echo -e "10.10.10.10 \n10.9.200.9 " | sort -V -k 1
10.9.200.9
10.10.10.10

Lee
_______________________________________________
support-seamonkey mailing list
support-seamonkey@lists.mozilla.org
https://lists.mozilla.org/listinfo/support-seamonkey

Reply via email to