Created
July 16, 2020 08:02
-
-
Save EdoardoVignati/85b242da5c22529f28e0ec2f4f27c591 to your computer and use it in GitHub Desktop.
Ask for confirmation in bash
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
read -r -p "Are you sure? [Y/n] " response | |
case "$response" in | |
[nN][oO]|[nN]) | |
#Do something on NO | |
;; | |
*) | |
#Do something on everything else | |
;; | |
esac |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment