I have a file with following values.
keyword1 19.02 1.69.94
keyword2 19.01 1.68.118
keyword3 19.02 1.69.119
keyword4 19.01 1.68.115
keyword5 19.02 1.69.304
keyword6 19.02 1.69.39
I want these to be sorted based on 3rd column.
In Linux, the following command using version sort works.
raj@VirtualBox:$ grep 19.02 file.txt | sort -t ' ' -k3 -V
keyword6 19.02 1.69.39
keyword1 19.02 1.69.94
keyword3 19.02 1.69.119
keyword5 19.02 1.69.304
On Unix(Solaris) the version sort seems to be missing. I searched around for working alternative on Solaris, but couldn't find one.
I can also use a solution in python.
-Voption tosortin yourgrep 19.02 file.txt | sort -t ' ' -k3 -Vexample is a non-standard, non-portable GNU extension to the POSIXsortutility.