Skip to content

Instantly share code, notes, and snippets.

@hellwolf
Created January 5, 2011 14:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hellwolf/766400 to your computer and use it in GitHub Desktop.
Save hellwolf/766400 to your computer and use it in GitHub Desktop.
bash getopts
while getopts "u:r:" opt;
do
case "$opt" in
"u")
SVN_URL=$OPTARG
;;
"r")
REVISION=$OPTARG
;;
*)
echo "UNKNOWN options" $opt
usage
esac
done
shift $(($OPTIND-1))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment