Created
November 15, 2011 13:56
-
-
Save rustymyers/1367128 to your computer and use it in GitHub Desktop.
getops example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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