Created
June 15, 2016 19:31
-
-
Save enil/5535e0443b3bbeed5a0c5a8e8c7a22e0 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
confirm() { | |
while true; do | |
read -p "$@" -n 1 answer | |
echo | |
case "$answer" in | |
[yY]) return 0 ;; | |
[nN]) return 1 ;; | |
esac | |
done | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment