#!/bin/ksh jpg=${1:-"*.jpg"} for i in $jpg do # timestamp the file with the exif date # use exiftool, jhead, or whatever exif extration # tool you like # echo "doing $i" time=`exiftool -d '%c' -DateTimeOriginal $i | sed 's/.* ://'` # echo "using time $time" # time=`jhead $i | grep "Date/Time" | sed 's/.* ://'` touch -d "$time" $i # echo "done" done