Last active
July 23, 2024 16:20
-
-
Save petergi/bad72c6913cf23e9821aa5394bd8f6e5 to your computer and use it in GitHub Desktop.
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
| #!/bin/bash | |
| echo "Would you like to 'x' [Y/n]?" | |
| read ans | |
| if [[ -z "$ans" ]] || [[ $ans = [Yy] || $ans = yes || $ans = Yes || $ans = YES ]]; then | |
| echo "Place the 'yes' action here." | |
| else | |
| if [[ $ans = [Nn] || $ans = no || $ans = No || $ans = NO ]]; then | |
| echo "Place the 'no' action here." | |
| else | |
| echo "Invalid option. Exiting." | |
| exit 1 | |
| fi | |
| fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment