Timeline for Output of 'watch' command as a list
Current License: CC BY-SA 3.0
11 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Oct 16, 2020 at 1:20 | comment | added | rinogo | Another benefit of this approach is that watch only supports intervals down to 0.1 seconds, while sleep supports "floating point numbers" as intervals (e.g. sleep 0.0001 works just fine). | |
| Jun 20, 2014 at 7:33 | comment | added | peterph | @derobert oh. Well, a quick glance at the procps CVS reveals how active the codebase has been in the last decade or so. I guess that's why it got forked into procps-ng (including your patch). | |
| Jun 20, 2014 at 7:25 | comment | added | derobert | @peterph Yeah, I sent it to Debian in bugs.debian.org/cgi-bin/bugreport.cgi?bug=183486 and Debian is using procps-ng. AFAIK, original procps upstream is unmaintained. | |
| Jun 20, 2014 at 7:19 | comment | added | peterph | @derobert you mean watch from procps-ng? For the "canonical" one from the procps definitely doesn't have this option. | |
| Jun 19, 2014 at 17:46 | comment | added | derobert | @peterph watch has a -p option that will do that right, if at all possible (obviously, you can't do a command that takes 5 seconds every 1 second, if you're not allowed multiple simultaneous). I know, I wrote it :-P | |
| Nov 19, 2012 at 13:28 | comment | added | peterph | Well, if lines per minute are the ultimate goal, then sampling it once every 10 seconds is more than enough imho - so the overhead is not that terrible (unless the file grows really big, of course). And actually from within the loop, one can print timing information (even both before and after the command finishes if necessary), and then the accuracy can get better (orders of magnitude) even for bigger files. | |
| Nov 19, 2012 at 13:22 | comment | added | Stéphane Chazelas | Indeed (I've checked both procps and busybox implementations). I thought that was the only thing watch was useful for, but it doesn't give you even that so your solution is as good as a watch based one, but neither answers the "rate at which a log file grows" question with great accuracy. | |
| Nov 19, 2012 at 12:26 | comment | added | peterph | @StephaneChazelas neither will it with wait - just try watch -n 1 "sleep 5". | |
| Nov 19, 2012 at 11:51 | comment | added | Stéphane Chazelas | However note that it will not do it exactly every second (with zsh or ksh93, you could adjust the sleeping time so as to account for the drift incurred by running the commands in the loop, though) | |
| Nov 19, 2012 at 11:49 | history | edited | Stéphane Chazelas | CC BY-SA 3.0 | added 3 characters in body |
| Nov 19, 2012 at 11:20 | history | answered | peterph | CC BY-SA 3.0 |