#
# Rename JPEGs to reflect the creation date stored in their metadata.
#
-# Copyright (C) 2010-2011 W. Trevor King <wking@drexel.edu>
+# Copyright (C) 2010-2012 W. Trevor King <wking@tremily.us>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
fi
if [ "$NEW_NAME" != "$FILE" ]; then
"${MV}" "$FILE" "$NEW_NAME"
+ BASE="${FILE%.*}"
+ NEW_BASE="${NEW_NAME%.*}"
+ for AUXILIARY in "${BASE}"*; do
+ if [ "${AUXILIARY}" != "${BASE}*" ]; then
+ EXTENSION="${AUXILIARY:${#BASE}}"
+ NEW_AUXILIARY="${NEW_BASE}${EXTENSION}"
+ echo "Auxiliary file ${AUXILIARY} -> ${NEW_AUXILIARY}"
+ "${MV}" "${AUXILIARY}" "${NEW_AUXILIARY}"
+ fi
+ done
fi
fi
fi