Last active
August 27, 2021 19:04
-
-
Save johnloy/d767687c2884e073a2f760f1b0601fb9 to your computer and use it in GitHub Desktop.
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
confirm() { | |
while true; do | |
read -p "$1 ([y]/n) " -r | |
REPLY=${REPLY:-"y"} | |
if [[ $REPLY =~ ^[Yy]$ ]]; then | |
return 1 | |
elif [[ $REPLY =~ ^[Nn]$ ]]; then | |
return 0 | |
fi | |
done | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment