All pastes #808655 Raw Edit

Someone

public text v1 · immutable
·published 2007-12-07 20:01 UTC
rendered paste body
#!/bin/sh
# stuff to try to explain getopts  command line options
# will echo out the flag used if used o.O
# else just weeeeeeeee
help() { echo "weeeeeeeeeeeeeeee"; exit 1; }
[ $# -eq 0 -o $# -gt 256 ] && help
for opt in $@; do case "${opt:0:2}" in --*) help;; esac; done

while getopts c:vh OPT; do case "${OPT}" in
c) opt="${OPTARG}";;
v) echo "rAWWWRR"
   ;;
h) help; exit 1;;
*) help; exit 1;;
esac; done

[ -n $opt ] && echo "${0//*\//}: got opt=\"${opt}\""
exit 0
~
~
~