1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-28 03:27:44 +00:00

sort: compatibility of human-numeric sort

Closes #1985.
This makes human-numeric sort follow the same algorithm as GNU's/FreeBSD's sort.
As documented by GNU in https://www.gnu.org/software/coreutils/manual/html_node/sort-invocation.html,
we first compare by sign, then by si unit and finally by the numeric value.
This commit is contained in:
Michael Debertol 2021-06-25 18:19:00 +02:00
parent fef8761ac1
commit 548a895cd6
6 changed files with 77 additions and 25 deletions

View file

@ -1,3 +1,4 @@
0K
K
844K
981K

View file

@ -1,3 +1,6 @@
0K
__
__
K
^ no match for key
_

View file

@ -9,4 +9,5 @@
844K
981K
13M
K
K
0K