ETOOBUSY 🚀 minimal blogging for the impatient
entr runs arbitrary commands when files change
In post (perl-c-ontinuous) I described a little script that monitors
the filesystem for a change in a target file, and runs
perl -c (the
compilation check) over the file, just to make sure I don’t introduce
syntax errors as I modify it.
I don’t know where, but I was later pointed towards entr, which generalizes this very idea in a program. It can control multiple files (the list is read in standard input) and do interesting things, like e.g. run a command only on a file that actually changed:
ls *.pl | entr perl -c /_
I did appreciate that the choice of the “file name placeholder”
The special /_ argument (somewhat analogous to $_ in Perl) …
I’m always glad when I see this kind of references to Perl ❤️
All in all, it seems amazing and worth checking out! Thanks to whoever drove my attention to it!