Skip to content

Instantly share code, notes, and snippets.

@jphpsf
Created October 14, 2012 18:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • 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