expr can only be use in plus or minus. I have error in using it in multiplication and division.
On Monday 19 July 2004 10:07, [EMAIL PROTECTED] wrote: > you have two options: > > c=`expr $a + $b` > > or > > c=`echo "$a+$b" | bc` > > > there might be a more efficient solution but that is all i know at the > moment. :) > > ciao! > > alben benavente alteza writes: > > in a bash script, how do we add two numbers like: > > > > a=1 > > b=2 > > > > c=$a+$b > > > > echo $c > > > > my script is treating the numbers as string. > > > > thanks > > > > -- > > Alben Benavente Alteza > > Information Systems Security and Internet Services Administration > > Information Systems Department / Philippine Airlines > > > > -- > > 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 > > -- > "Programming, an artform that fights back" > > Anuerin G. Diaz > Registered Linux User #246176 > Friendly Linux Board @ http://mandrakeusers.org/index.php -- Alben Benavente Alteza Information Systems Security and Internet Services Administration Information Systems Department / Philippine Airlines -- 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
