1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
| #!/bin/sh
test $# -gt 1 || {
echo "l'appel de ce script doit comporter _deux_ arguments numériques
$0 nombre_1 nombre_2"
if test $# -eq 1
then echo "saisir une valeur"
read arg2
arg1=$1
else test $# -eq 0
echo "saisir deux valeur"
read arg1
read arg2
fi
if test $arg1 -gt $arg2
then echo "$arg2 est inférieur à $arg1"
elif test $arg1 -lt $arg2
then echo "$arg1 est inférieur à $arg2"
else echo "$arg1 et $arg2 sont égaux"
fi
exit 1
}
if test $1 -gt $2
then
echo "$2 est inférieur à $1"
elif test $1 -lt $2
then
echo "$1 est inférieur à $2"
else
echo "$1 et $2 sont égaux"
fi |