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

21 lines
400 B
Text
Raw Normal View History

2013-06-28 05:22:14 -07:00
#!/usr/bin/env bash
2021-07-29 00:37:35 -07:00
# YES_ZSH
# YES_BASH
# NO_DASH
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:-}" ] \
&& 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
}
[ -n "${preload+-}" ] || pause "$@"