#!/bin/sh SOURCE=./cv.tex compile() { pdflatex -halt-on-error $SOURCE } compile while : do inotifywait -e modify ./cv.tex echo "file has changed" compile done