Created
December 3, 2010 21:53
-
-
Save emk/727621 to your computer and use it in GitHub Desktop.
Rerun a command automatically whenever files in a directory change
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# Usage: find . -name \*.hs | rerun make | |
# | |
# Install inotifywait using 'sudo apt-get install inotify-tools' or whatever. | |
# | |
# Automatically re-run a command when a file changes. Assumes that your | |
# text editor closes files after each write. Pipe file names on standard | |
# input. | |
inotifywait --fromfile - --monitor --quiet --event close_write | \ | |
while read; do "$@"; done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment