In the script I want to check if the java is installed and if is it newer than 1.8.
java -version 2>$1 >/dev/null | egrep "\S+\s+version" | awk '{print substr($3,0,5)}' | tr -d '"'
I guess the results can be like this:
1.8.0_225
11.0.2
1.6.1_223
so to make it comparable it will be good to map this values to \d+\.\d+
:
1.80225
11.02
1.61223
It can be done by replacing everything which is not a digit to nothing except first dot.