🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.unix.shell
Article #1010

Re: bourne shell query

#1010
From: Jeff Beadles
Date: Thu, 30 Aug 1990 20:34
26 lines
1120 bytes
scott@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@quark.WV.TEK.COM 
Utek Engineering, Tektronix Inc.	+1 503 685 2568
			SPEEA - Just say no.
Technical Details
Message-ID: <8465@orca.wv.tek.com>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!mailrus!cs.utexas.edu!uunet!zephyr.ens.tek.com!orca.wv.tek.com!quark!jeff
References: <26DC6447.15922@maccs.dcss.mcmaster.ca> <8446@orca.wv.tek.com> <SCOTT.90Aug30124930@tab00.larc.nasa.gov>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!mailrus!cs.utexas.edu!uunet!zephyr.ens.tek.com!orca.wv.tek.com!quark!jeff
From: jeff@quark.WV.TEK.COM (Jeff Beadles)
Newsgroups: comp.unix.shell
Subject: Re: bourne shell query
Message-ID: <8465@orca.wv.tek.com>
Date: 30 Aug 90 20:34:55 GMT
References: <26DC6447.15922@maccs.dcss.mcmaster.ca> <8446@orca.wv.tek.com> <SCOTT.90Aug30124930@tab00.larc.nasa.gov>
Sender: news@orca.wv.tek.com
Reply-To: jeff@quark.WV.TEK.COM (Jeff Beadles)
Organization: Tektronix, Inc., Wilsonville, OR
Lines: 26