[clug] Sorting Version Numbers
jeffm at ghostgun.com
Mon Jan 8 23:12:37 UTC 2018
Say you have a set of version numbers of the for x.y.z-m.n.o where
x,y,x, m, n, and o are positive integers, eg 2.6.32-541.5.12. Is there a
one liner that can sort these? I've tried piping it into sort but that
only seems to work with the first number (eg sort -n -t\- -k2). I could
solve it with a scripting language but it's part of a one liner to
remove old kernels from the system.
Here's an example of real input the I'm trying to sort,
Anyone have any thoughts on this?
More information about the linux