From e681db38f30aa5e30036c04bb4aa93aa448eddc4 Mon Sep 17 00:00:00 2001 From: SinTan1729 Date: Tue, 29 Jun 2021 22:50:52 +0530 Subject: [PATCH] rewrote latex-cleanup --- latex-cleanup | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/latex-cleanup b/latex-cleanup index 37351bd..8720a54 100755 --- a/latex-cleanup +++ b/latex-cleanup @@ -2,6 +2,14 @@ #!/bin/bash -[ 0 -lt $(ls *.tex 2>/dev/null | wc -w) ] && find . -maxdepth 1 -type f -regex ".*\.\(aux\|log\|synctex.gz\|bbl\|blg\)" -exec totrash {} \; +for f in *.tex; do + h=$(basename "$f" .tex) + echo "Trashing files accompanying $h.tex..." + for g in "$h".*; do + if [[ ${g: -4} != ".tex" && ${g: -4} != ".pdf" ]] ; then + echo "Trashing $g..." + totrash "$g" + fi + done +done echo "Done!" -