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
|
#
### Declaration de la fonction FctTest
#
FctTest()
{
if [ "$1" == "" ] ; then
return #-- termine la fonction
fi
if [ "$DATA" == "" ] ; then
echo "bye"
return #-- termine la fonction
fi
echo "recommence"
}
echo "* procedure principale"
set arg1 arg2 arg3
DATA="blabla"
#
### Appel de la fonction avec passage de $3
### Nota : dans la fonction, l'argument devient $1 (1ere position)
#
echo "* exécution FctTest"
FctTest $3
echo "* retour procedure principale"
exit |