I’m trying to write a bash script that increments the version number which is given in
{major}.{minor}.{revision}
For example.
1.2.13
Is there a good way to easily extract those 3 numbers using something like sed or awk such that I could increment the {revision} number and output the full version number string.
Here is how it works:
The string is split in two parts.
${v%.*}${v##*.}The first part is printed as is, followed by a plain dot and the last part incremented using shell arithmetic expansion:
$((x+1))