~martanne/devel

This thread contains a patchset. You're looking at the original emails, but you may wish to use the patch review UI. Review patch

[PATCH] Sleep until the next minute

Details
Message ID
<20231101210735.321739-1-mail@thomasvoss.com>
DKIM signature
missing
Download raw message
Patch: +1 -1
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
Reply to thread Export thread (mbox)