Showing posts with label variable. Show all posts
Showing posts with label variable. Show all posts

2007/06/03

shell: expresiones aritmeticas

Hay dos posibilidades, utilizar el operador aritmetico $(()):


    i=1
    i=$(($i+1))
    echo $i


o bien el comando shell 'expr':


    i=1
    i=`expr $i + 1`
    echo $i


AH