First page Back Continue Last page Overview Graphics
La commande getopts
Une commande pour traîter plus simplement les arguments d'un script
- while getopts f:ri opt; do
case $opt in
r) echo "r present";;
i) echo "i present";;
f) echo "f present with argument $OPTARG";;
esac
- done
- shift $(expr $OPTIND - 1)
- echo "command arguments:"
- for arg in $@; do
echo " $arg"
- done