Created
January 25, 2017 15:19
-
-
Save vandorjw/993f5f35bca5ab6e7c1dbf331e783763 to your computer and use it in GitHub Desktop.
bash 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
| #!/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