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. As others have said, use $(( )) or $[ ]. Actually, to the original poster, do "man bash" and read it from one end to the other. It's long, so set aside a little time. Michael -- Michael Darrin Chaney [EMAIL PROTECTED] http://www.michaelchaney.com/ -- 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
