{"id":59,"description":"bash: arithmetic expansion","tags":["bash","shell","programming"],"contents":["# $((expression)) - evaluates the expression and substitutes the result.","echo $((3+5)) # prints 8","# spaces are totally fine","f=$((4 + 4)) # evaluate the expression and assign the value to a variable","g=$((f * 2)) # variables inside the expression need not be specified with a preceding $ sign","echo $((g--)) $((g++)) # increment, decrement","echo ((g += 5) # assignment operators (= *= /= %= += -= \u003c\u003c= \u003e\u003e= \u0026= ^= |=) are also supported"]}
