1
0
Fork 0
mirror of https://github.com/notwa/rc synced 2024-11-05 04:39:03 -08:00
rc/sh/pause

20 lines
393 B
Bash
Executable file

#!/usr/bin/env bash
# YES_ZSH
# YES_BASH
# NO_DASH
pause() { ### @-
### pause — the companion script of `confirm`.
###
### ```
### $ pause
### Press any key to continue
### $
### ```
[ -n "${ZSH_VERSION:-}" ] \
&& read -sk '?Press any key to continue
' || read -n1 -u 1 -sp 'Press any key to continue
'
}
[ "${SOURCING:-0}" -gt 0 ] || pause "$@"