Last active
January 2, 2020 21:18
-
-
Save ericwastaken/d8878186c94de32093ee402a4da0481c to your computer and use it in GitHub Desktop.
Example of a BASH script that outputs some text then waits for confirmation before proceeding.
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 "Say something here to confirm some action." | |
echo "" | |
# Wait for the user to press any KEY to proceed or allow them to Ctrl+C | |
read -n1 -rsp $'Press any key to continue or Ctrl+C to exit...\n' | |
# Do your work after this... it won't execute if the user does Ctrl+C at the prompt! | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment