I\'m trying to write a bash script that increments the version number which is given in
{major}.{minor}.{revision}
For example.
<
$ v=1.2.13
$ echo "${v%.*}.$((${v##*.}+1))"
1.2.14
$ v=11.1.2.3.0
$ echo "${v%.*}.$((${v##*.}+1))"
11.1.2.3.1
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))