I need to extract version number from the following strings .
pattern looks like this.
by using shell script
VAR1=1.1-g13ab57737123
Output 1.1
VAR1=1.2-g328891ahqq12
Output 1.2
VAR1=2.3-g123900a12328
Output 2.3
VAR2=abcd960_1.1-g13ab57737123
Output 1.1