Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- # Define the menu options
- menu_options=("Option 1" "Option 2" "Option 3" "Quit")
- # Set the menu prompt
- PS3="Choose an option: "
- # Create the menu using the select command
- select name in "${menu_options[@]}"; do
- case $name in
- "Option 1")
- echo "You chose Option 1"
- ;;
- "Option 2")
- echo "You chose Option 2"
- ;;
- "Option 3")
- echo "You chose Option 3"
- ;;
- "Quit")
- echo "Exiting the menu"
- break # Exit the loop
- ;;
- *)
- echo "Invalid choice. Please try again."
- ;;
- esac
- done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement