Skip to content

Instantly share code, notes, and snippets.

@supersym
Created November 6, 2012 18:42
Show Gist options
  • Save supersym/4026644 to your computer and use it in GitHub Desktop.
Save supersym/4026644 to your computer and use it in GitHub Desktop.
Bash scripts
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