I want to be able to extract the individual numbers from a version string and assign each value to a variable.
echo -en "Please Enter A "$RPM_FILTER" Version Number (e.g. "$VER_EXAMPLE"):"
I want to be able to assign for example
1 to $a, 16 to $b and 0 to $c for use in a sed filter.
Specify Version Number (y/n)? y
Please Enter A Version Number (e.g. 1.16.0): 1.16.0
read -p " " VERSION
I am using this currently but this does not work when the individual version number is two digits.
declare -i a=$(printf "%s\n" "$VERSION" | cut -c 1)
declare -i b=$(printf "%s\n" "$VERSION" | cut -c 3)
declare -i c=$(printf "%s\n" "$VERSION" | cut -c 5)