4 ms·
This is so excellent. I was smiling as I read it. Thank you. My personal favourite "watcher" implementation is this: while true; do make; sleep 0.5; done
by dblotsky 9y ago
This is so excellent. I was smiling as I read it. Thank you.
My personal favourite "watcher" implementation is this:
while true; do make; sleep 0.5; done
- FrenchyJiby 9y agoI don't understand: why not the classic `watch make` (watch defaults to 2 seconds)?
- cdancette 9y agoWhy waste 1.5s of your life? Or watch -n 0.5 make does the job too
- teamhappy 9y agoWatch is Linux-only.
- khedoros1 9y agoI see it in Cygwin, in the procps-ng package, and available on OSX through Brew. Doesn't seem Linux-only.
- teamhappy 9y agoMy bad. I figured it needs /proc since it's part of the procps package.
- pantalaimon 9y agoWhy would it? You can literally write it as a shell script #!/bin/bash N=2 while true; do clear echo Every $N\s: $* $* sleep $N done
- teamhappy 9y agoI though maybe it had some flag that makes it display process information or something. Anything that would justify it being part of procps really.
- orf 9y agoIt's not
- nwellnhof 9y agoMore precisely, it isn't a POSIX utility.
- dblotsky 9y agoBecause it's my favourite. You're 100% free to have a different favourite. Also, indeed, watch isn't available on all systems (e.g. macOS).
- FrenchyJiby 9y agoThat's fair. I didn't realise it was not available everywhere, it's one of those things I keep thinking are in coreutils until it's not there on an OS (funny enough, I keep thinking half the commands I use are like that ... until it breaks)
- pvtmert 9y agoi personally use inodenotify (linux) and fswatch (osx) works well while running on battery :)
- Groxx 9y agoI'm an `entr` fan, personally. Super easy to compose with other tools, steps around common minor mistakes (backs off when there are rapid changes, can abort running processes when changes occur or ignore, etc).
- henry_flower 9y agothanks! I'm glad you liked it!