Instead of always sleeping for a full minute, this patch will ensure
that the loop sleeps until the end of the current minute. This means
that if you start the script at 00:00:30, it will print the current time
at 00:01:00 instead of at 00:01:30.
---
dvtm-status | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dvtm-status b/dvtm-status
index f841e3f..837d1dd 100755
--- a/dvtm-status
+++ b/dvtm-status
@@ -6,7 +6,7 @@ FIFO="/tmp/dvtm-status.$$"
while true; do
date +%H:%M
- sleep 60
+ sleep $((60 - $(date +%S)))
done > "$FIFO" &
STATUS_PID=$!
--
2.42.0