From 89fc98d809e007522b5867810813952c7dedcb06 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Mon, 8 Jun 2020 15:37:03 -0500 Subject: Implement 'sleep' as a builtin --- bollux | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/bollux b/bollux index 10a0c65..1378961 100755 --- a/bollux +++ b/bollux @@ -36,6 +36,12 @@ die() { # die EXIT_CODE MESSAGE exit "$ec" } +# builtin replacement for `sleep` +# https://github.com/dylanaraps/pure-bash-bible#use-read-as-an-alternative-to-the-sleep-command +sleep() { # sleep SECONDS + read -rt "$1" <> <(:) || : +} + # https://github.com/dylanaraps/pure-bash-bible/ trim_string() { # trim_string STRING : "${1#"${1%%[![:space:]]*}"}" -- cgit 1.4.1-21-gabe81