Created
March 16, 2016 05:08
-
-
Save bfatemi/961a533d8214dfb9b7f9 to your computer and use it in GitHub Desktop.
Snippet to trap a keystroke. Press any key to continue...
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
#!/bin/bash | |
readOne () { | |
tput smso | |
echo "Press any key to return \c" | |
tput rmso | |
oldstty=`stty -g` | |
stty -icanon -echo min 1 time 0 | |
dd bs=1 count=1 >/dev/null 2>&1 | |
stty "$oldstty" | |
echo | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment