Skip to content

Instantly share code, notes, and snippets.

@prnthh
Created October 30, 2017 22:27
Show Gist options
  • Select an option

  • Save prnthh/480c1117bf49e64c884be988ed676bab to your computer and use it in GitHub Desktop.

Select an option

Save prnthh/480c1117bf49e64c884be988ed676bab to your computer and use it in GitHub Desktop.
inotifywait macro for restarting a process when a file change is detected
rerun(){
while inotifywait -e create,delete,modify .;
do
kill %% //kills the last background process
$@ & //spawns new process in background
done;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment