Created
March 19, 2020 05:54
-
-
Save dennbagas/0d11be13d468e2fbcd763a192cc4fa11 to your computer and use it in GitHub Desktop.
shell match every args
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
if [ $# -gt 0 ]; then | |
for i in "$@" | |
do | |
if [[ "$i" =~ ^--case1\S* ]]; then | |
local args; | |
args="${i#*=}" | |
elif [[ "$i" =~ ^--case2\S* ]]; then | |
local args; | |
args="${i#*=}" | |
fi | |
done | |
else | |
usage-help | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment