Skip to content

Instantly share code, notes, and snippets.

@Kif11
Created June 14, 2017 22:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Kif11/28fb1de1111fd811d8d5537039eae279 to your computer and use it in GitHub Desktop.
Save Kif11/28fb1de1111fd811d8d5537039eae279 to your computer and use it in GitHub Desktop.
Bash basic case statement
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