I am trying to write a cmd script to parse the java version from the java -fullversion
command. I am able to retrieve the version like that: 1.6.0_45
, 1.7.0_60
, 1.8.0_212
, 11.0.4
. I would like to return the versions as 6
, 7
, 11
. As you can see not all of these appear before the first dot.
I have found the following sed command that works and would like to know the windows cmd equivalent:
sed '/^1\./s///'