Skip to content

Instantly share code, notes, and snippets.

@rustymyers
Created November 15, 2011 13:56
Show Gist options
  • Save rustymyers/1367128 to your computer and use it in GitHub Desktop.
Save rustymyers/1367128 to your computer and use it in GitHub Desktop.
getops example
while getopts a:l? opt; do
case "$opt" in
a) variable="$OPTARG";;
l) list="LONG";;
h)
help
exit 0;;
?)
help
exit 0;;
\?)
help
exit 0;;
esac
done
shift `expr $OPTIND - 1`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment