1
0
Fork 0
mirror of https://github.com/SinTan1729/random.git synced 2024-12-26 21:18:36 -06:00
random/latex-cleanup

21 lines
528 B
Text
Raw Normal View History

2021-12-28 02:54:26 -06:00
#!/bin/sh
2021-04-19 13:54:49 -05:00
2022-01-02 22:35:07 -06:00
# I use it to clean up latex build files from a directory after I'm done with the project.
2021-12-31 02:07:19 -06:00
# Depends on trash-cli
2021-06-29 12:20:52 -05:00
for f in *.tex; do
2021-12-28 23:59:05 -06:00
if [ -f "$f" ]; then
h=$(basename "$f" .tex)
echo "Trashing files accompanying $h.tex..."
for g in "$h".*; do
k=$( echo $g | sed 's/^.*\.//')
if [ "$k" != "tex" ] && [ "$k" != "pdf" ] && [ "$k" != "bib" ] ; then
echo "Trashing $g..."
2021-12-31 02:07:19 -06:00
trash "$g"
2021-12-28 23:59:05 -06:00
fi
done
fi
2021-06-29 12:20:52 -05:00
done
2021-04-19 13:54:49 -05:00
echo "Done!"