Skip to content

Instantly share code, notes, and snippets.

@oborichkin
Created October 20, 2019 14:52
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save oborichkin/ab408104e115b69dd3f009c085e9a7a3 to your computer and use it in GitHub Desktop.
Save oborichkin/ab408104e115b69dd3f009c085e9a7a3 to your computer and use it in GitHub Desktop.
Waiting for keypress in bash
#!/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