Created
May 4, 2020 14:08
-
-
Save nirgeier/6d5ff005b081e724fe0e12945ffa939b to your computer and use it in GitHub Desktop.
dummy
This file contains 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
# without `:` the values are optionals | |
while getopts abc flag; | |
do | |
case "${flag}" | |
in | |
a ) echo $optarg ; pa="$OPTARG"; echo $pa;; | |
b ) pb=${OPTARG};; | |
c ) pc=${OPTARG};; | |
\?) echo "Invalid option: kubde" 1>&2 ;; | |
: ) echo "Invalid option: $OPTARG requires an argument" 1>&2;; | |
esac | |
done | |
echo 'P1:' "$pa" | |
echo $P2 | |
echo $P3 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment