Created
May 15, 2014 12:16
-
-
Save fpinzn/e8bed0d0d48428618445 to your computer and use it in GitHub Desktop.
This file contains 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/sh | |
# Displays the received arguments as options and returns the option selected | |
# Set the prompt for the select command | |
PS3="Type a number or 'q' to quit: " | |
# Show a menu and ask for input. If the user entered a valid choice return it. | |
select option in "$@"; do | |
if [ -n "$option" ]; then | |
echo ${option} | |
fi | |
break | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment