Hi,

On 11.04.21 04:13, Ice Ninja wrote:
I cannot explain why a hyphen - can change the sorting order.

$ sort -V <<<'2.yamlmode
2.1.yamlmode
2.1.yaml-mode
2.yaml-mode'
2.yamlmode
2.1.yamlmode
2.1.yaml-mode
2.yaml-mode

I assume the following result is expected.
2.yamlmode
2.1.yamlmode
2.yaml-mode
2.1.yaml-mode

Is it a bug or are there rules I am not aware of.

This might be because ".yamlmode" is considered a file extension,
while ".yaml-mode" is not.

https://www.gnu.org/software/coreutils/manual/coreutils.html#Special-handling-of-file-extensions

HTH,
Erik

Reply via email to