GNU bug report logs -
#28846
Maybe a bug in "sort (GNU coreutils) 8.4" report
Previous Next
Reported by: Tree Big <kakaxixi777 <at> gmail.com>
Date: Sun, 15 Oct 2017 08:54:02 UTC
Severity: normal
Tags: notabug
Merged with 28847
Done: Pádraig Brady <P <at> draigBrady.com>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
forcemerge 28846 28847
tag 28846 notabug
close 28846
stop
On 15/10/17 01:03, Tree Big wrote:
> Dear coreutils :
> I am a Research and Development Engineer in IT. I met a situation when I
> use “sort” command in Linux shell which could be a bug for the "sort"
> command. So I hope you read this email, thank you !
>
> The whole command I used was :
> *sort test.txt*
>
> *And the result was :*
> 20171012|3|2059517|-|8|-|20-24|2|-|2.0|2.0
> 20171012|3|2059517|-|82|-|25-29|2|-|13.0|12.0
> 20171012|3|2059517|-|8|-|-2|-2|-|71.0|64.0
> 20171012|3|2059517|-|82|-|30-34|0|-|2.0|1.0
Since at least field 5 is variable width
you can't so a simple sort on the whole line.
I'm not sure exactly what field order you want
but you'll want something like:
sort -t'|' -k1,1 -k5,5n
cheers,
Pádraig
This bug report was last modified 7 years and 219 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.