I have a variable which has a math expression. I want to evaluate it in UNIX shell and store the result in another variable. how do i do that ?
i tried the following but it doesn't works
var1="3+1"
var2=`expr "$var1"`
echo $var2
the var2 value should be calculated as 4.