/ Published in: Bash
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
while true; do case "$1" in -h|--help|-\?) show_help; exit 0;; -v|--verbose) verbose=1; shift;; -a) if [ $# -gt 1 ]; then UNAME=$2; shift 2 else echo "-a requires an argument" 1>&2 exit 1 fi ;; --) shift; break;; -*) echo "invalid option: $1" 1>&2; show_help; exit 1;; *) break;; esac done