Sometimes you want a command to be automatically executed as soon as a certain file changes. There is a small tool called entr, which helps with that.

0 points

What’s wrong with a simple path unit?

permalink
report
reply
1 point

I am not exactly sure what you mean by that… But the main advantage is that the command does not have to be executed manually everytime you change something. Instead entr recognizes when something changes and re-executes the command for you.

permalink
report
parent
reply
0 points

That’s what a systemd.path unit accomplishes, too. It watches a path, and if that file/directory changes, it starts its accompanying systemd.service.

permalink
report
parent
reply
1 point

Ah, you are talking about systemd, wasn’t aware of that… I imagine that to be much more complicated for many use cases. E.g. running a unit test (as I describe in the article) isn’t something I would use systemd for. Setting up a path and a service seems more complicated than using entr, and it is probably also harder to get to the output as well.

permalink
report
parent
reply

Community stats

  • 1

    Monthly active users

  • 267

    Posts

  • 1.2K

    Comments

Community moderators