I'm trying to make a script to do something when a file is modified. This would work if I run the watcher in another terminal and I edit the file in another vim instance.
However, what I want is that the script opens the vim instance and then run the watcher to do things when I save the file.
This is my script, run.sh:
#!/usr/bin/env bash
vim chart.csv
inotifywait --quiet --recursive --monitor --event modify chart.csv | while read; do
notify-send "hi, world"
done
If you have gnome-terminal, then
Update
If you want kill the process when
vimquits, try this :