about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorCase Duckworth2020-06-08 15:37:03 -0500
committerCase Duckworth2020-06-08 15:37:03 -0500
commit89fc98d809e007522b5867810813952c7dedcb06 (patch)
treea3b09c3a62377d21b8fee473c0e85ceb41f7a2e5
parentSet BOLLUX_URL on 3* status codes (diff)
downloadbollux-89fc98d809e007522b5867810813952c7dedcb06.tar.gz
bollux-89fc98d809e007522b5867810813952c7dedcb06.zip
Implement 'sleep' as a builtin
-rwxr-xr-xbollux6
1 files changed, 6 insertions, 0 deletions
diff --git a/bollux b/bollux index 10a0c65..1378961 100755 --- a/bollux +++ b/bollux
@@ -36,6 +36,12 @@ die() { # die EXIT_CODE MESSAGE
36 exit "$ec" 36 exit "$ec"
37} 37}
38 38
39# builtin replacement for `sleep`
40# https://github.com/dylanaraps/pure-bash-bible#use-read-as-an-alternative-to-the-sleep-command
41sleep() { # sleep SECONDS
42 read -rt "$1" <> <(:) || :
43}
44
39# https://github.com/dylanaraps/pure-bash-bible/ 45# https://github.com/dylanaraps/pure-bash-bible/
40trim_string() { # trim_string STRING 46trim_string() { # trim_string STRING
41 : "${1#"${1%%[![:space:]]*}"}" 47 : "${1#"${1%%[![:space:]]*}"}"