Parse RPM version string in Bash
Hello,
I am very new to bash scripting and I am trying to break down a rpm version string into four separate strings.
Basically I have a Version string I retrieve from a file( for example sake lets say it is "1.0.1-05" and I would like to break it down and store it into four separte strings/or numbers. I think I might be able to use the awk/sed command to do this but I can not figure out the usage.
VER_STR="1.0.1-05"
#Perform sed awk to Parse out
#version values as followes
# VER_MAJOR="1"
# VER_MINOR="0"
# VER_BUILD="1"
# VER_REL="05"
Any suggestions or help will be greatly appreciate.
Best Regards,
-Jim
|