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.



Reply via email to