# use bc to do simple calculations echo "(1+1+2)/3" |bc
# Make calculations with floating point bc -l
# Do simple calculation bc <<< 1+2
# Do simple subtraction bc <<< "2 - 1"
# Store result of calculation in a variable var1=$(echo $var2 + 30.4 | bc)