Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function choose {
- echo " What does NLX stand for"
- local default="$1"
- local prompt="$2"
- local choice_yes="$3"
- local choice_no="$4"
- local answer
- read -p prompt answer
- [ -z "$answer" ] && answer="$default"
- case "$answer" in
- [yY1] ) eval "$choice_yes"
- #error check
- ;;
- [nNo] eval "choice_no"
- #error check
- ;;
- * ) printf "%b" "Unexpected Answer '$answer'" >&2 ;;
- esac
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement