[ale] simple math in bash

Mike Kachline kachline at cc.gatech.edu
Mon Nov 17 17:41:18 EST 1997


On Sat, 15 Nov 1997, David Hamm wrote:

> I can't remember how to do simple math in bash.  I used to know but I cant find
<snip>

	Don't know whether there is an easier way, but, I have always 
used "dc" to do math in shell scripts. Ex, adding 1 + 1 would be:

echo "1 1 + p q" | dc

							- Mike
============================================================================
Michael Kachline - CS, Georgia Tech
kachline at cc.gatech.edu
http://brightstar.gt.ed.net/kachline/
============================================================================






More information about the Ale mailing list