Skip to content

Instantly share code, notes, and snippets.

@dynnamitt
Last active August 29, 2015 14:11
Show Gist options
  • Save dynnamitt/b002b25fc1e5cea1c0be to your computer and use it in GitHub Desktop.
Save dynnamitt/b002b25fc1e5cea1c0be to your computer and use it in GitHub Desktop.
Run CMD in an inotify loop, restarting inotifywait each time to ensure new dirs get hooked in. Runs on $PWD
#!/bin/sh
#function for yo .bashrc/.zshrc
inotify_delay_cmd() {
while true; do
inotifywait -r -e create -e delete -e modify --exclude '^\./\..+' .
"$@"
done
}
# usage:
# $ cd my-code; inotify_delay_cmd ctags -R
# $ cd my-code-2; inotify_delay_cmd make
@dynnamitt
Copy link
Author

apt-get install inotify-tools

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment