Skip to content

Instantly share code, notes, and snippets.

@tynn
Created March 31, 2014 12:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tynn/9891323 to your computer and use it in GitHub Desktop.
Save tynn/9891323 to your computer and use it in GitHub Desktop.
The pause command suitable for a shell.
#!/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