#!/bin/sh test -z "$1" && printf "Pass at least one file\n" && exit 1 file_in=$(realpath "$1") file_out="/tmp/output.pdf" printf "Watching file %s\nOutput is %s\n" $file_in $file_out compile_command='groff -R -man -ms -e -p -t -Tpdf '"$file_in"' > '"$file_out" ls $file_in|entr -s "$compile_command"