Automatically trigger commands on source change

Sometimes, you need to write a source file and “compile” (as in “run a generic script on it”) each time you edit it, just to see the final result. On Ubuntu, you can use the inotifywait command to keep an eye on filesystem operations. sudo apt install inotify-tools You can create a simple bash file such as this: #!/bin/sh inotifywait -m . -e modify | while read path action file; do # Do something....

February 14, 2018