#!/bin/bash for FILE in $(find bilder/ -iname '*.xml') ; do if [ ! -f "${FILE%.xml}.pdf" -o "$FILE" -nt "${FILE%.xml}.pdf" ] ; then ipetoipe -pdf -runlatex $FILE ${FILE%.xml}.pdf fi done for f in "Formelsammlung.tex" "Wahrscheinlichkeitstheorie_und_Statistik.tex" ; do if [ ! -f "${f/.tex/.toc}" ] ; then # Run it twice to generate TOC pdflatex "$f" fi pdflatex "$f" done