Created
October 25, 2018 06:31
-
-
Save binzeehale/6bce783ad91c512e57737e0dd5e900b4 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
#!/bin/bash | |
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} | |
;; | |
*) | |
usage | |
;; | |
esac | |
done | |
shift $((OPTIND-1)) | |
if [ -z "${s}" ] || [ -z "${p}" ]; then | |
usage | |
fi | |
echo "s = ${s}" | |
echo "p = ${p}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment