I have written a bash script that I need to work identically on linux and mac osx that relies on the sort command. I am piping the output of git tag -l
to sort to get a list of all the version tags in the correct semantic order. GNU offers -V
which makes this automagic but mac osx does not support this argument so i need to figure out how to accomplish this sort order without it.
6.3.1.1
6.3.1.10
6.3.1.11
6.3.1.2
6.3.1.3
...
needs to be sorted as
6.3.1.1
6.3.1.2
6.3.1.3
...
6.3.1.10
6.3.1.11
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…