Where it worked...
tt=0000005
echo $((tt))
tt=$(($tt 1))
echo $((tt))
5
6
Somewhere it stopped working...
tt=0056505
echo $((tt))
tt=$(($tt 1))
echo $((tt))
23877
23878
CodePudding user response:
You need to trim the leading zeros first
$ tt=0056505
$ tt=$(echo $tt | sed 's/^[0]*//g')
$ echo $((tt))
56505
$ tt=$(($tt 1))
$ echo $((tt))
56506