case $# in 0) echo "usage : puiss n p"; exit ;; 1) echo "usage : puiss n p"; exit ;; 2) expr $1 + 0 2>/dev/null>/dev/null if [ $? -ge 2 ] then echo "l'argument $1 n'est pas un entier" exit fi if [ $1 -lt 0 ] then echo "argument $1 negatif" exit fi expr $2 + 0 2>/dev/null>/dev/null if [ $? -ge 2 ] then echo "l'argument $2 n'est pas un entier" exit fi if [ $2 -lt 0 ] then echo "argument $2 negatif" exit fi i=1 j=1 while ( [ $i -le $2 ] ) do j=`expr $j \* $1` i=`expr $i + 1` done echo "$1 puissance $2 est egal a : "$j;; *) echo "trop d'arguments"; exit;; esac