3

Shell arithmetic problem

view full story
linux-howto

http://forums.fedoraforum.org – Hi, I'm trying to learn shell scriptig using bash and was trying to learn some basic arithmetic using variables. The script I am trying to write adds says z = x + y. I've been trying to use expr and the script is as follows: Code: x=6 y=3 z='expr x + y' echo $z When I run the script the return is expr x + y I am stuck as to why it's not running the addition and just returning the text. I've also tried z='expr $x + $y' but the return for echo $z is just expr $x + $y (HowTos)