Error:

Calculate value of expression

# var is 40
let var="23 + 17"

a=10
b=12
# var is 22
var=$((a+b))

Get random number in range

# var is random number form 1 to 10
((var = RANDOM % 10 + 1))

Convert hex to decimal

hex=32
# dec is 50 (0x32)
dec=$(( 16#${hex} ))

Convert decimal to hex

dec=32
# hex is 20
hex=$(printf '%x' $dec)