Created
November 17, 2011 20:12
-
-
Save jasonmc/1374358 to your computer and use it in GitHub Desktop.
A script that uses inotiftwait to look for changes in all files with given extension, and run specifed command. Useful for compiling LaTeX.
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
onchangerecur . 'pdflatex -interaction batchmode thesis.tex' .tex |
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/sh | |
PLACE="$1" | |
COMMAND="$2" | |
EXT="$3" | |
inotifywait -rqme CLOSE_WRITE --format '%f' $PLACE | while read f; | |
do | |
if echo "$f" | grep $EXT$; then | |
sh -c "$COMMAND" | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment