▲ 21 ▼ Run a shell script whenever a file in a certain directory changes? (lemmy.ml) submitted 1 year ago by helloworld@lemmy.ml to c/linuxquestions@lemmy.zip 23 comments fedilink hide all child comments Using a shell script, can I watch a folder and block program execution until a file in a certain folder changes?
[–] hperrin@lemmy.ca 15 points 1 year ago Oh god please don’t do this. Constantly reading the file is just stressing your IO for no reason. Please inotify instead: https://linux.die.net/man/1/inotifywait permalink fedilink source parent