- create your "x.c" file
- create "run.sh" file with the following:
# run for the first time
gcc x.c
./a.out
inotifywait -q -m -e close_write examen.c |
while read -r filename event; do
# run after tweaking the file
gcc x.c
./a.out
done
- chmod +x ./run.sh
- sh run.sh
- Hack away in your editor, now the C file will run on every file change
Necessary dependency
sudo apt install inotify-tools -y