bourne shell query
Jeff Beadles
jeff at quark.WV.TEK.COM
Fri Aug 31 06:34:55 AEST 1990
scott at tab00.larc.nasa.gov (Scott Yelich) writes:
>As a side question, does ANYONE have any bourne shell routines which do
>math... reasonably effeciently? (For numbers > 1000?)
Well, I use expr. For example:
a=123456
b=123
c=`expr $a - $b`
d=`expr $a \* $b`
echo "c = $c"
echo "d = $d"
Note, that the '*' MUST be quoted, as the shell will expand it.
"Shell qouting -- Know it, live it, be it. -Jeff" :-)
-Jeff
--
Jeff Beadles jeff at quark.WV.TEK.COM
Utek Engineering, Tektronix Inc. +1 503 685 2568
SPEEA - Just say no.
More information about the Comp.unix.shell
mailing list