Index | Thread | Search

From:
Job Snijders <job@sobornost.net>
Subject:
Re: responsive watch wip
To:
Ted Unangst <tedu@tedunangst.com>
Cc:
tech@openbsd.org
Date:
Tue, 10 Jun 2025 06:23:02 +0000

Download raw body.

Thread
Hi Ted,

Thanks for looking into this!

Something isn't quite right: watch 'date; sleep 5; date' displays
the output of date(1) every second and you can see duplicates
running in the process tree:

     `-- watch date; sleep 5; date
       |-- /bin/sh -c date; sleep 5; date
       | `-- sleep 5
       |-- /bin/sh -c date; sleep 5; date
       | `-- sleep 5
       |-- /bin/sh -c date; sleep 5; date
       | `-- sleep 5
       |-- /bin/sh -c date; sleep 5; date
       | `-- sleep 5
       `-- /bin/sh -c date; sleep 5; date
         `-- sleep 5

The correct behaviour is that watch displays the date(1) output every
5 seconds. The interval is intended to be "the pause between runs",
not "execute command every X seconds, duplicates are fine". I hope
this clarifies.

Kind regards,

Job