A memo on how to add +1 to the value of a variable number in the Bash language of the Linux command line.
This doesn’t work.
var+=1
var=var+1
Because it becomes this.
$ var=1
$ var+=1
$ echo $var
11
$ var=1
$ var=var+1
$ echo $var
var+1
Do it this way.
$ var=1
$ var=$((var+2))
$ echo $var
3
$ var=$((var+2))
$ echo $var
5