Sunday, February 7, 2016

How to do arithmetic calculations using linux terminal

Pipe the expression to bc

echo "$a / ( $b - 34 )" | bc -l

Reference: http://stackoverflow.com/questions/15015809/floating-point-results-in-bash-integer-division

No comments:

Post a Comment