Skip to content

Instantly share code, notes, and snippets.

@GeorgiosGoniotakis
Created September 25, 2021 19:50
Show Gist options
  • Save GeorgiosGoniotakis/443f2ad8cf819fd16143b26151f3dc68 to your computer and use it in GitHub Desktop.
Save GeorgiosGoniotakis/443f2ad8cf819fd16143b26151f3dc68 to your computer and use it in GitHub Desktop.
Yes/No Prompt Shell Scripting
while true; do
read -p "Are you sure you want to continue? " yn
case $yn in
[Yy]* ) call_function; break;;
[Nn]* ) exit;;
* ) echo "Please answer yes or no.";;
esac
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment