Using bash, I'd like to sort and filter a list to retain only the last patch version (top value) per minor version (per group). For example:
$ cat data | sort -Vr
3.10.1
3.10.0
3.3.10
3.3.2
3.3.1
3.2.0
3.1.0
3.0.3
3.0.2
3.0.1
3.0.0
I'd like to get this result:
3.10.1
3.3.10
3.2.0
3.1.0
3.0.3
How to do it?