If the original version number is stored in a variable, you can use
substring replacement. For example
Code:
old_version=4.1.0.1.22
new_version=${old_version/1.22/0.22}
otherwise use sed, as in
Code:
new_version=$(echo 4.1.0.1.22 | sed s/4[.]1[.]0[.]1[.]22/4.1.0.0.22/}
the square brackets around the dots in the pattern are
character lists: this is a way to make sed interpret a literal dot, otherwise it has the special meaning of
any single character and the strings 4c1.0d1.22 or 4.1e0.1922 match as well.