#!/bin/sh if [ -z "$1" ]; then echo "Set EXIF timestamp from file modification time" echo "usage: $0 file1.jpg file2.jpg ..." exit 0 fi while [ ! -z "$1" ]; do file="$1" if [ `basename "${file}" ".jpg"`".jpg" = "${file}" ]; then echo "setting EXIF timestamp for $file" # Write file modification time to EXIF timestamp exiftool "-DateTimeOriginal