#!/bin/bash # to clean the "*.blg *.bbl *.aux *.spl" files # usage: # cleanlatex option # -l : just list those files # -f : remove by force # -dvi : dvi files as well # -name : only those with a specifc filename # e.g., # cleanlatex -l # cleanlatex -f -name pdftest -dvi # http://scriptdemo.blogspot.com [ $# -eq 0 ] && sed -n '3,11p' `which cleanlatex` && exit isFLname=0 isForce=0 isList=0 isDvi=0 isDebug=0 fname='*' while test -n "$1" do case "$1" in -l|-L) isList=1 shift ;; -f|-F|-force|-del|-remove) isForce=1 shift ;; -dvi) isDvi=1 shift ;; -name) fname=$2 fname=${fname%.*} shift; shift; ;; -debug|-Debug) isDebug=1 shift ;; *) echo "unkown option: $1" shift ;; esac done [ ${isList} -eq 1 ] && isForce=0 flist="${fname}.spl ${fname}.aux ${fname}.bbl ${fname}.blg ${fname}.log" [ ${isDvi} -eq 1 ] && flist="${flist} ${fname}.dvi" if [ ${isForce} -eq 0 ]; then if [ ${isDebug} -eq 1 ]; then echo "ls ${flist}" else eval "ls ${flist} 2>/dev/null" fi exit else if [ ${isDebug} -eq 1 ]; then echo "rm -f ${flist}" else eval "rm -f ${flist} 2>/dev/null" fi fi |
Thursday, July 5, 2012
[Bash] remove the temporary files generated by latex
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment