diff options
author | Case Duckworth | 2020-06-08 15:37:03 -0500 |
---|---|---|
committer | Case Duckworth | 2020-06-08 15:37:03 -0500 |
commit | 89fc98d809e007522b5867810813952c7dedcb06 (patch) | |
tree | a3b09c3a62377d21b8fee473c0e85ceb41f7a2e5 | |
parent | Set BOLLUX_URL on 3* status codes (diff) | |
download | bollux-89fc98d809e007522b5867810813952c7dedcb06.tar.gz bollux-89fc98d809e007522b5867810813952c7dedcb06.zip |
Implement 'sleep' as a builtin
-rwxr-xr-x | bollux | 6 |
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 | ||
41 | sleep() { # sleep SECONDS | ||
42 | read -rt "$1" <> <(:) || : | ||
43 | } | ||
44 | |||
39 | # https://github.com/dylanaraps/pure-bash-bible/ | 45 | # https://github.com/dylanaraps/pure-bash-bible/ |
40 | trim_string() { # trim_string STRING | 46 | trim_string() { # trim_string STRING |
41 | : "${1#"${1%%[![:space:]]*}"}" | 47 | : "${1#"${1%%[![:space:]]*}"}" |