"Leggi Argomenti" template per script
Template per script che legge argomenti da riga di comando:
#!/bin/bash
# FUNCTIONS
function help () {
cat <
Syntax: `basename $0` [ -h ]
Description: Descrizione script
Options: -h help (questo help)
-a Opzione "A"
-b Opzione "B"
EOF
}
# VARIABILI
# OPZIONI
while getopts ha:b: var
do
case $var in
h) help; exit
;;
a) echo "Opzione "-a" con argomento $OPTARG";
;;
b) echo "Opzione "-b" con argomento $OPTARG";
esac
done
shift ` expr $OPTIND - 1 `
- fabio's blog
- Login to post comments

