Created
March 31, 2014 12:34
-
-
Save tynn/9891323 to your computer and use it in GitHub Desktop.
The pause command suitable for a shell.
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/sh | |
# 2014 CC0 http://creativecommons.org/publicdomain/zero/1.0/ | |
# A little implementation of pause. | |
[ -t 0 ] || exit | |
[ $# -ge 1 ] && msg="$@" || msg="Press any key ..." | |
read -p "$msg" -n 1 c | |
[ x"$c" = x"" ] || echo -e "\b " |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment