Skip to content

Instantly share code, notes, and snippets.

@sandinmyjoints
Last active December 16, 2015 05:19
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 sandinmyjoints/5383754 to your computer and use it in GitHub Desktop.
Save sandinmyjoints/5383754 to your computer and use it in GitHub Desktop.
#!/bin/bash
# Author:
# Email:
# Date: yyyy-mm-dd
# Usage: script.sh [-a|--alpha] [-b=val|--beta=val]
# Description:
#
#
#
# Defaults #
A=false
B="Foo"
# Parse Parameters #
for ARG in $*; do
case $ARG in
-a|--alpha)
A=true
;;
-b=*|--beta=*)
B=${ARG#*=}
;;
*)
echo "Unknown Argument $ARG" ;;
esac
done
# Do Some Stuff #
echo "Usage script.sh [-a|--alpha] [-b=val|--beta=val]"
echo "A: $A"
echo "B: $B"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment