watch — run a command when a watched file changes

watch is a tiny program that monitors a set of files and runs a command every time any one (or more) of them changes.
Download the source code: watch-1.0.tar.gz
Browse the source code: watch-1.0
Why is this useful? I like to run TeX every time I save a document file so I can see the changes immediately without any manual intervention. To do this I use:
watch *.tex - 'make document.ps'
(Previewing programs like ghostview have a 'watch source file' mode and can refresh themselves automatically if it changes, which really does mean zero-intervention between saving the .tex file and seeing a new formatted version.)

watch is distributed under the MIT license. It will not infect you with a contagious disease if you decide to modify it for your own open-source use.

If you find bugs or have suggestions, please send them to Ian at the domain name of this web site. Thanks!