for i in "nav:tex" "snm:tex" "toc:tex" "blg:tex" \
"idx:tex" "ilg:tex" "ind:tex" "lof:tex" "lot:tex" "lou:tex" \
"dvi:tex" "log:tex" "aux:tex" "bbl:tex" \
- "ps:tex" "pdf:tex" "out:tex" "tpt:tex" "brf:tex" \
+ "ps:tex" "pdf:tex" "out:tex" "tpt:tex" "brf:tex" "vrb:tex" \
"eps:fig" "eps:png" "eps:pgm" \
"o:cc" "o:c" ; do
PRODUCED=$(echo $i | cut -f 1 -d:)
for f in *.$PRODUCED; do
ORIGINAL=${f/.$PRODUCED/.$SOURCE}
if [ -f "${ORIGINAL}" ]; then
- echo "move $f to ${TRASH} ($ORIGINAL exists)"
- mv $f ${TRASH}
+ if [ "${f}" -nt "${ORIGINAL}" ]; then
+ echo "Moving file $f to ${TRASH} ($ORIGINAL exists)"
+ mv $f ${TRASH}
+ else
+ echo "File $f is older than $ORIGINAL. Keeping both."
+ fi
fi
done
done