Bash Arithmetic Expansion
Arithmetic expansion does math inside $(( )) and puts the result in its place. You can use +, -, *, /, % and parentheses.
Inside the parentheses you can leave out the $ before variable names. Bash only works with whole numbers, so 7 / 2 gives 3.
Do some math
x=10
y=3
echo "$x + $y = $((x + y))"
10 + 3 = 13
echo $((x * y)) $((x / y)) $((x % y))
30 3 1
Add one to a counter
count=5
count=$((count + 1))
echo $count
6