Created
December 28, 2014 17:57
-
-
Save FlorianWolters/3f5bad441360c8a404ae to your computer and use it in GitHub Desktop.
Windows `pause` command in *-nix Shell (Bash)
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 | |
function pause() { | |
if [ "$#" -eq 0 ] | |
then | |
PROMPT="Press any key . . ." | |
else | |
PROMPT="$1" | |
fi | |
read -n1 -r -p "$PROMPT" | |
} | |
# Default behavior. | |
pause | |
# Custom prompt. | |
pause "Press that any key!" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment