I'm trying to create a script that compiles LaTeX on OS X. Unfortunately I'm not familiar with the language and even though the code works, it has several flaws. Is it possible to close the terminal without having to kill it (and every other instance of it)? Can it be improved easily to automatically find and compile all .tex-files in the folder?
#!/bin/bash STR="document" BASEDIR="$( dirname "$0" )" cd "$BASEDIR" pdflatex $STR.tex bibtex $STR.aux pdflatex $STR.tex pdflatex $STR.tex rm $STR.ilg rm $STR.toc rm $STR.aux rm $STR.out open $STR.pdf killall Terminal