I want to dive integers but my results would be a digit bash can't do digits:
from=69;to=64;steps=$(( 12-1 )); ssize=$(( (to - from) / steps ))
echo $ssize $steps
results
0 11
Edit:
bc works with multiplication:
echo "5.94*11.14" | bc
gives 66.17
but division
echo "5.94/11.14" | bc
gives 0
echo
to produce?ssize
is zero because bash only does integer arithmetic (-5/11 = 0) – glenn jackman Oct 07 '15 at 18:33echo "scale=3; 5.94/11.14" | bc
orecho "5.94/11.14" | bc -l
– glenn jackman Oct 07 '15 at 19:30