Skip to content

Instantly share code, notes, and snippets.

@jonaslindmark
Created February 6, 2015 15:14
Show Gist options
  • Save jonaslindmark/df541a7132930d14f2ed to your computer and use it in GitHub Desktop.
Save jonaslindmark/df541a7132930d14f2ed to your computer and use it in GitHub Desktop.
#!/bin/bash
# usage ./notify.sh [path to folder] [command line to execute on change]
while true
do
set -e
inotifywait -q -r --exclude ".git|.idea" -e close_write,moved_to,create $1 > /dev/null
set +e
eval ${*:2}
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment