You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
18 lines
380 B
18 lines
380 B
#!/bin/sh
|
|
|
|
echo "donnez une suite d'entiers (CTRL + d pour sortir) : "
|
|
read a #a contient le plus petit
|
|
|
|
if echo "$a" | egrep -q '^[0-9]+$' ; then
|
|
while read n ; do
|
|
if echo "$n" | egrep -q '^-?0-9+$' ; then
|
|
if [ $n -lt $a ] ; then
|
|
a=$n
|
|
fi
|
|
else echo "Attention !! il y a une erreur !!!" >&2
|
|
fi
|
|
done
|
|
else
|
|
echo "attention ! Votre arg doit etre un entiers" >&2
|
|
fi
|