I've never work with shell (bash), but found some bug in script, that I used to increment version. Script works fine, until this case
version=1.27.9
echo $version | awk -F. -v OFS=. 'NF==1{print ++$NF}; NF>1{if(length($NF+1)>length($NF))$(NF-1)++; $NF=sprintf("%0*d", length($NF), ($NF+1)%(10^length($NF))); print}'
1.28.0 <-- result, but I need 1.27.10
In this case new_version
will be equals to 1.28.0
. How to change this script to avoid incrementing MINOR number? For this case I expecting 1.27.10
I've no experience in shell, so don't know where to start. I found this script here, on SO and use it. Please help me to solve my problem. Thank you in advance.