Those 2 sequences of lines are not sorted the same by the Linux shell command sort (gnu-coreutils 8.22 under RHEL 7.8), even though they begin with the same distinct prefixes. Why ?
$ echo "f'*.5.7
f'9.0.0
f'*.9.6
"|sort
f'*.5.7
f'9.0.0
f'*.9.6
$ echo "f'*.5
f'9.0
f'*.9
"|sort
f'*.5
f'*.9
f'9.0
export LANG=Cbefore running the two commands? 2. same result when you write your three lines to text files and sort thesesort < file_with_lines.txtkind of thing (or justsort file_with_lines.txt)?LC_ALL=Cif you don't want that (orLC_COLLATEin specific, I think). See also e.g.: Unexpected sort order in en_US.UTF-8 locale Why does sort say that ɛ = e?