The bc utility
bc is an arbitrary precision numeric processing language, which can be used to compute simple arithmetic from the command line.
Note: The following examples, were taking from a Solaris 10 system
To generate decimal values:
Note: scale specifies how many digits to the right of the decimal point. The following demonstrates, 2 digits after decimal point:
# echo "scale=2; 701664/1052624" | bc
To use the result of the previous calculation, automatically:
Note: use the (.) operator