Skip to content

Instantly share code, notes, and snippets.

@infamousjoeg
Created July 8, 2018 20:05
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 infamousjoeg/f019d6fc6da4e07f03383a1bff64c03c to your computer and use it in GitHub Desktop.
Save infamousjoeg/f019d6fc6da4e07f03383a1bff64c03c to your computer and use it in GitHub Desktop.
A Simple Bash Menu Script
#!/bin/bash
# Bash Menu Script Example
# Heading
echo; echo "SSH Menu"; echo
# Menu
PS3='Please enter your choice: '
options=("Server 1" "Server 2" "Quit")
select opt in "${options[@]}"
do
case $opt in
"Server 1")
ssh server-1@example.com; break
;;
"Server 2")
ssh server-2@example.com; break
;;
"Quit")
break
;;
*) echo invalid option;;
esac
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment