this post was submitted on 13 Nov 2023
1 points (100.0% liked)

Linux

4 readers
2 users here now

founded 1 year ago
 

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.

you are viewing a single comment's thread
view the rest of the comments
[โ€“] Chais@sh.itjust.works 0 points 10 months ago (1 children)

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.

[โ€“] danrot@kbin.social 1 points 10 months ago

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.