next up previous contents
Next: The .login and .cshrc Up: Variables Previous: Unset variables   Contents

Arithmetic expressions using variables

Arithmetic expressions are a bit tortuous and use the expr command:-

>  one=1
>  two=2
>  three=`expr $one + $two`
>  echo $three
3

note the use of the back quote string - see section 6.2.7.



P.D. Gronbech (IT Staff) 2015-10-02