Last active
October 5, 2016 00:24
-
-
Save dpkoch/7fa3aea40dba544ece3e to your computer and use it in GitHub Desktop.
Bash script for removing generated LaTeX files
This file contains hidden or 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/bash | |
EXTENSIONS=".aux .log .nav .out .snm .synctex.gz .toc .bbl .blg -blx.bib .bcf .run.xml .acn .acr .alg .glg .glo .gls .ist .lof .lot .auxlock .synctex.gz(busy) .vrb .fls .fdb_latexmk .latexmk" | |
MAXDEPTH="-maxdepth 1" | |
if [ "$1" = "-r" ] || [ "$1" = "-R" ]; then | |
MAXDEPTH="" | |
fi | |
find . $MAXDEPTH -type f -name "*.tex" | while read FILE | |
do | |
DIRNAME=$(dirname "$FILE") | |
FILENAME=$(basename "$FILE" .tex) | |
for EXT in $EXTENSIONS; do | |
rm -vf "$DIRNAME/$FILENAME$EXT" | |
done | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment