You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

47 lines
1.3 KiB

1 year ago
#!/bin/bash
usage() { echo "Usage: $0 [-f file]" 1>&2; exit 1; }
LATEX=xelatex
#$(LATEX) $(FILE_NAME)
#clean:
# @rm -f *.log *.aux *.dvi *.ps *.blg *.bbl *.out *.bcf *.run.xml
while getopts ":f:" o; do
case "${o}" in
f)
cwdir=$PWD
s=${OPTARG}
BASEDIR=$(dirname "$s")
BASENAME=$(basename "$s")
#echo $BASEDIR
#echo $BASENAME
#echo "==> change to $BASEDIR"
#cd $BASEDIR
#rm -f *.log *.aux *.dvi *.ps *.blg *.bbl *.out *.bcf *.run.xml
find $BASEDIR -type f -name '*.log' | xargs rm -f
find $BASEDIR -type f -name '*.lof' | xargs rm -f
find $BASEDIR -type f -name '*.aux' | xargs rm -f
find $BASEDIR -type f -name '*.dvi' | xargs rm -f
find $BASEDIR -type f -name '*.ps' | xargs rm -f
find $BASEDIR -type f -name '*.blg' | xargs rm -f
find $BASEDIR -type f -name '*.bib' | xargs rm -f
find $BASEDIR -type f -name '*.bbl' | xargs rm -f
find $BASEDIR -type f -name '*.out' | xargs rm -f
find $BASEDIR -type f -name '*.bcf' | xargs rm -f
find $BASEDIR -type f -name '*.run.xml' | xargs rm -f
echo "==> change to $cwdir"
cd $cwdir
;;
*)
usage
;;
esac
done
shift $((OPTIND-1))
if [ -z "${s}" ]; then
usage
fi