Created
September 25, 2021 19:50
-
-
Save GeorgiosGoniotakis/443f2ad8cf819fd16143b26151f3dc68 to your computer and use it in GitHub Desktop.
Yes/No Prompt Shell Scripting
This file contains 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 | |
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