Skip to content

Instantly share code, notes, and snippets.

@jphpsf
Created October 14, 2012 18:23
Show Gist options
  • Save jphpsf/3889392 to your computer and use it in GitHub Desktop.
Save jphpsf/3889392 to your computer and use it in GitHub Desktop.
Trigger a command when file changes (bash function)
function loop {
echo -e "\nWaiting for changes..."
while inotifywait -qr -e close_write .
do
clear && $@ && echo -e "\nWaiting for changes..."
done
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment