coreutils
[Top][All Lists]
Advanced

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

Re: sort:An unexpected result is displayed in the sort result.


From: Chris Elvidge
Subject: Re: sort:An unexpected result is displayed in the sort result.
Date: Fri, 5 Nov 2021 14:28:03 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 Lightning/5.4

On 05/11/2021 09:31 am, Yang Yanchao wrote:
Dear Coreutils Maintainers,



When I sort the use cases using "sort":

[root@localhost test]# cat test

1.2.v1.6

1.0.v3.5

1.10.v2.4

[root@localhost test]# sort -n -t'.' -k3,3 -k4,4 test

1.10.v2.4

1.0.v3.5

1.2.v1.6



The order I expected should be like this.

1.2.v1.6

1.10.v2.4

1.0.v3.5



It looks like the third column is alphabetic, and I added the -n option, which 
was ignored, but I used -k to specify the third column as the first 
priority.This means that -k has a lower priority than -n? Does this fit the 
intended design?



Thanks,

Yang Yanchao


Try -V instead of -n

--
Chris Elvidge
England




reply via email to

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