The problem# In a shell script, I wanted to use inotifywait's --monitor option to watch for changes to files, but I didn't care how many changes had been made, only whether or not changes had been made. I wanted to use --monitor as if more changes where made later, I still wanted to get notified...
The problem# I had a script where at some point a program I did not directly control would create a file, but I wanted that file's permissions to be different than those it got created with. The simple solution was to run chmod in a loop waiting for it to succeed with a short sleep delay between...
The problem# For a compile-on-save workflow where some computation is done in response to every change to a file, if there may sometimes be many changes close together, it may be wasteful to respond to all of them. This is often handled by debouncing the events: instead of responding to every...