Skip to content

Instantly share code, notes, and snippets.

View GiuseppeLota's full-sized avatar

Giuseppe GiuseppeLota

View GitHub Profile
@GiuseppeLota
GiuseppeLota / getops_tmpl.sh
Last active October 11, 2017 16:32
Bash getops template
usage() { echo "Usage: $0 [-s <45|90>] [-p <string>]" 1>&2; exit 1; }
while getopts ":s:p:" o "$@";
do
case $o in
s) s=${OPTARG}
((s == 45 || s == 90)) || usage;;
p)p=${OPTARG};;