Created
October 20, 2019 14:52
-
-
Save oborichkin/ab408104e115b69dd3f009c085e9a7a3 to your computer and use it in GitHub Desktop.
Waiting for keypress 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
#!/bin/bash | |
wait_for_key () { | |
echo "Press any key to continue" | |
while [ true ] ; do | |
read -t 3 -n 1 | |
if [ $? = 0 ] ; then | |
break ; | |
fi | |
done | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment