1
0
Fork 0
mirror of https://github.com/SinTan1729/random.git synced 2024-12-25 20:58:37 -06:00

made POSIX compliant

This commit is contained in:
Sayantan Santra 2021-12-28 23:59:05 -06:00
parent 9f7f550b5e
commit 1e5d77c8a4

View file

@ -3,13 +3,16 @@
#!/bin/sh
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
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..."
totrash "$g"
fi
done
fi
done
echo "Done!"