Created
November 15, 2013 20:41
-
-
Save tarmstrong/7491208 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
#!/usr/bin/env bash | |
while [ 1 ]; | |
do | |
cp ~/test.txt ~/test.txt.old | |
EVENT=$(inotifywait --format '%e' ~/test.txt); | |
[ $? != 0 ] && exit | |
[ "$EVENT" = "MODIFY" ] && echo 'file modified!' | |
diff ~/test.txt ~/test.txt.old | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment