Subject: bug#76290: "sort -u" vs "sort -h -u": possible bug

From: Rupert Gallagher <[email-masked]>
Date: Tue, 18 Feb 2025 18:45:57 +0000

Dictionary sort corresponds to the intended behaviour.

> echo -e "abc\n123\n456\nCVE-2011-234\nAbc\ndef\nCVE-2024-123" | sort --debug -dfu

123
___
456
___
abc
___
CVE-2011-234
____________
CVE-2024-123
____________
def
___

By comparison, human (-h) and numeric (-n) sort cause data loss:

> echo -e "abc\n123\n456\nCVE-2011-234\nAbc\ndef\nCVE-2024-123" | sort --debug -hu
sort: note numbers use ‘.’ as a decimal point in this locale
abc
^ no match for key
123
___
456
___

If I were the author of gnu sort, I would delete the -h and -n options.