tag 51011 notabug
close 51011
stop
On 04/10/2021 15:36, Juncheng Yang wrote:
Hi coreutils developers,
I have encountered a bug in GNU sort in which sort produces incorrect
results when numerical sort with delimiters. For example,
sort -nk1 -t , file
cannot sort the a file with the following lines (sort by the first column
numerically)
1,a
0,9
I have tried multiple version including the latest version, this problem still
exists.
The --debug option points out the issue:
$ printf '%s\n' 1,a 0,9 | sort --debug -nk1 -t ,
sort: key 1 is numeric and spans multiple fields
1,a
_
___
0,9
___
___
So you want -k1,1n
cheers,
Pádraig