From 28cde1285482f0493cb1e4e78b9464c17b096811 Mon Sep 17 00:00:00 2001 From: PowerUser64 Date: Fri, 7 Apr 2023 04:46:12 -0700 Subject: [PATCH] sleep-until: fix dry output --- .config/shell/bin/sleep-until | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.config/shell/bin/sleep-until b/.config/shell/bin/sleep-until index 8955a5e..f0ff26b 100755 --- a/.config/shell/bin/sleep-until +++ b/.config/shell/bin/sleep-until @@ -8,8 +8,8 @@ if [ -n "$1" ] && date --date="$*" > /dev/null 2>&1; then # Calculate the time in seconds to sleep by subtracting the future time from the current time SLEEP_TIME="$(( $(date -f - +%s- <<< "$*"$'\nnow') 0 ))" if [ "$SLEEP_TIME" -gt 0 ]; then - echo "Sleeping until: $(date --date="$*") (${SLEEP_TIME}s)" if ! "$DRY"; then + echo "Sleeping until: $(date --date="$*") (${SLEEP_TIME}s)" sleep "$SLEEP_TIME" else echo "$SLEEP_TIME"