mirror of
https://github.com/notwa/rc
synced 2024-11-05 08:29:02 -08:00
20 lines
393 B
Bash
Executable file
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 "$@"
|