Skip to content

Instantly share code, notes, and snippets.

@vandorjw
Created January 25, 2017 15:19
Show Gist options
  • Select an option

  • Save vandorjw/993f5f35bca5ab6e7c1dbf331e783763 to your computer and use it in GitHub Desktop.

Select an option

Save vandorjw/993f5f35bca5ab6e7c1dbf331e783763 to your computer and use it in GitHub Desktop.
bash case statement
#!/bin/bash
# -- ********************************************************************************
# -- Description: Example case statements
# -- Version: 0.1
# -- ********************************************************************************
case "$1" in
hello)
echo 'hello'
;;
goodbye)
echo 'goodbye'
;;
*)
echo "Invalid parameter (hello; goodbye;) Exiting."
;;
esac
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment