Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/sh
- ask_if_continue () {
- while true; do
- # Prompt
- echo "Continue? (y/N)"
- read yesno
- # To lower case.
- yesno=`echo $yesno | tr [A-Z] [a-z]`
- # Break on valid only.
- if [ "$yesno" = "y" ]; then
- # It's yes.
- echo "Yes"
- break
- elif [ "$yesno" = "n" ]; then
- # It's no.
- echo "No"
- return
- fi
- done
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement