Why does 'sort' ignore special characters, like the asterisk?
Setting LC_ALL=C restored the traditional sorting order in my case. Package: coreutils Version: 8.5-1ubuntu3
export LC_ALL=C
sort --version-sort filename
This preserves the natural order of numbers.
Version: sort (GNU coreutils) 8.26
I do it inline:
LANG=C sort FILE
Or by function (changes the original file):
dosort() { local file="$*"; LANG=C sort ${file} -o ${file}.swp; mv ${file}.swp ${file}; cat ${file} ;}