2013-06-28 05:22:14 -07:00
|
|
|
#!/usr/bin/env bash
|
2021-07-29 00:37:35 -07:00
|
|
|
# YES_ZSH
|
2021-07-29 05:44:12 -07:00
|
|
|
# YES_BASH
|
|
|
|
# NO_DASH
|
2021-09-23 06:48:05 -07:00
|
|
|
# NO_ASH
|
2021-07-29 00:37:35 -07:00
|
|
|
|
2021-07-30 17:57:08 -07:00
|
|
|
pause() { ### @-
|
2021-08-01 09:27:25 -07:00
|
|
|
### pause — the companion script of [`confirm`.](#confirm)
|
2021-07-30 17:57:08 -07:00
|
|
|
###
|
|
|
|
### ```
|
|
|
|
### $ pause
|
|
|
|
### Press any key to continue
|
|
|
|
### $
|
|
|
|
### ```
|
2021-07-29 00:37:35 -07:00
|
|
|
[ -n "${ZSH_VERSION:-}" ] \
|
2021-07-29 05:44:12 -07:00
|
|
|
&& read -sk '?Press any key to continue
|
|
|
|
' || read -n1 -u 1 -sp 'Press any key to continue
|
|
|
|
'
|
2021-07-29 00:37:35 -07:00
|
|
|
}
|
|
|
|
|
2021-08-02 13:48:46 -07:00
|
|
|
[ -n "${preload+-}" ] || pause "$@"
|