/ Published in: Bash
Tests whether the script has been invoked with the correct number of parameters.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
E_WRONG_ARGS=85 script_parameters="-a -h -m -z" # -a = all, -h = help, etc. if [ $# -ne $Number_of_expected_args ] then echo "Usage: `basename $0` $script_parameters" # `basename $0` is the script's filename. exit $E_WRONG_ARGS fi