Created
November 6, 2012 18:42
-
-
Save supersym/4026644 to your computer and use it in GitHub Desktop.
Bash scripts
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
while true | |
do | |
echo -n "Please confirm (y or n) :" | |
read confirm | |
case $confirm in | |
y|Y|YES|yes|Yes) | |
break | |
;; | |
n|N|no|NO|No) | |
echo Aborting - you entered $confirm | |
exit | |
;; | |
*) echo Please enter only y or n | |
esac | |
done | |
echo You entered $confirm. Continuing ... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment