Created
June 14, 2017 22:37
-
-
Save Kif11/28fb1de1111fd811d8d5537039eae279 to your computer and use it in GitHub Desktop.
Bash basic case statement
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
cmd=$1 | |
case $cmd in | |
"cmd1") | |
shift | |
# execute cmd1 | |
;; | |
"cmd2") | |
shift | |
# execute cmd2 | |
;; | |
*) | |
# print help | |
esac |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment