Skip to content

Instantly share code, notes, and snippets.

@n8kowald
Last active August 6, 2017 10:58
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 n8kowald/13efec1a657b9f6d0db0142b422ae2fa to your computer and use it in GitHub Desktop.
Save n8kowald/13efec1a657b9f6d0db0142b422ae2fa to your computer and use it in GitHub Desktop.
Bash shell script helpers
# Choose from an array of strings
echo "Please choose the environment"
local envs=('staging' 'pre-live' 'live')
select env in "${envs[@]}"
do
case $env in
"staging") break;;
"pre-live") break;;
"live") break;;
"Quit") break;;
*) echo invalid option;;
esac
done
echo "You chose: $env"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment