perform floating point calculations in bash
May 1st, 2007 by Lawrence David
turns out floating point division (or any other type of floating point math) isn’t built-into the bash shell. instead, you’ll have to use the bc utility:
echo “6.0/10″ | bc -l
echo ‘4*a(1)’ | bc -l