|
From: | Pádraig Brady |
Subject: | bug#51011: [GNU sort] Numerical sort with delimiter may be broken (bug) |
Date: | Mon, 4 Oct 2021 16:58:38 +0100 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:84.0) Gecko/20100101 Thunderbird/84.0 |
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
[Prev in Thread] | Current Thread | [Next in Thread] |