made POSIX compliant

This commit is contained in:
Sayantan Santra 2021-12-28 23:59:05 -06:00
parent 9f7f550b5e
commit 1e5d77c8a4
1 changed files with 11 additions and 8 deletions

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!"