Is there a program that will automatically re-run, eg, make
, when files are modified?
For example, when I'm writing sphinx
documentation, it would be nice if make html
was run automatically each time I edit any relevant files.
Make works by inspecting information about files, not their contents. Make works out dependencies between targets and their dependencies, and then looks to see whether the files exist. If they do, it asks the operating system for the time and date the file was last modified.
entr. entr is a simple and excellent command-line utility for running arbitrary commands when any modifications occur in a given directory. “entr” stands for Event Notify Test Runner.
To watch log files that get rotated on a daily base you can use the -F flag to tail command. The tail -F will keep track if new log file being created and will start following the new file instead of the old file.
In Linux, we can use the inotify interface to monitor a directory or a file. We do this by adding a watch to the directory or file.
Well, since make will not do anything if nothing has changed, how about
while true; do sleep 60; make html; done
or the equivalent in your shell of choice? I don't think the usual file system layers are event-driven in such a way that they will you notify you of file changes without doing some similar themselves, but it's possibly DBUS can do that sort of stuff.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With