Skip to content

Instantly share code, notes, and snippets.

@rhtyd

rhtyd/cs-x-y.sh

Created Jan 9, 2015
Embed
What would you like to do?
domains=1
instances=1
usage(){
echo "usage: $0 [-d domains] [-i instances]"
echo " -d number of domains to create (defaults to 1)"
echo " -i number of instances to create (defaults to 1)"
echo " -h (prints this help)"
}
while getopts d:i:h opt
do
case "$opt" in
d) domains="$OPTARG";;
i) instances="$OPTARG";;
h) usage
exit 0;;
/?) # unknown flag
usage
exit 1;;
esac
done
echo Creating $domains Domains
echo Creating $instances Instances
// Use captured variables to do stuff here...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment