----- Original Message ----- 
From: "Michael Chaney" <[EMAIL PROTECTED]>
To: "Philippine Linux Users Group Mailing List" <[EMAIL PROTECTED]>
Sent: Tuesday, July 20, 2004 10:31 AM
Subject: Re: [plug] bash script question


> On Mon, Jul 19, 2004 at 10:08:34AM +0800, Federico Sevilla III wrote:
> > Anyway, back to the topic, Bash treats all variables as strings, AFAIK.
> > One approach is to pipe the output to bc, an arbitrary precision
> > calculator, as in:
> >
> >     c = `echo "$a+$b" | bc`
> >     echo $c
> >
> > I'm sure there are many other ways of doing this, but this one works
> > pretty well IMO. :)
>
> Creating a couple of extra processes to do something that sh does just
> fine on its own.  Tsk tsk tsk.

true but shell's arithmetic is only deals with integers and not with
reals... that is one of the advantage when using jijo's suggestion...

fooler.


--
Philippine Linux Users' Group (PLUG) Mailing List
[EMAIL PROTECTED] (#PLUG @ irc.free.net.ph)
Official Website: http://plug.linux.org.ph
Searchable Archives: http://marc.free.net.ph
.
To leave, go to http://lists.q-linux.com/mailman/listinfo/plug
.
Are you a Linux newbie? To join the newbie list, go to
http://lists.q-linux.com/mailman/listinfo/ph-linux-newbie

Reply via email to