#! /bin/bash # Last edited on 2003-07-20 19:41:57 by stolfi usage="${0##*/} DIR..." # Lists dates of all full-size raw JPG or TIF images the # given Mavica CD image directories. if [ $# -lt 1 ]; then echo "usage: ${usage}"; exit 1; fi curdir="`pwd`" tmp="/tmp/$$" tmpdirs="${tmp}.dirs" tmpdates="${tmp}.dates" tmpimgs="${tmp}.imgs" for dir in $@ ; do cd ${curdir} cd ${dir} ls -a1 \ | egrep '[.](JPG|TIF|jpg|tif) *$' \ | egrep -v '[-][a-z][.]' \ > ${tmpimgs} if [ -s ${tmpimgs} ]; then rm -f ${tmpdates} for f in `cat ${tmpimgs}` ; do /usr/bin/printf "%s " ${f} >> ${tmpdates} strings ${f} \ | egrep '200[23]:[01][0-9]:[0-3][0-9] ' \ | head -1 \ >> ${tmpdates} done cat ${tmpdates} | sort -b +1 > .dates /usr/bin/printf "%s %s -- %s\n" ${dir} "`head -1 .dates`" "`tail -1 .dates`" fi done rm -f ${tmp}.*