From: W. Trevor King Date: Sat, 10 Sep 2011 13:14:13 +0000 (-0400) Subject: Add NAME_BY_DATE_FIELD_NAME override to name-by-date.sh. X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=557fd4fb1ae585f70922a008ef90f52b7e76fa6b;p=mw2txt.git Add NAME_BY_DATE_FIELD_NAME override to name-by-date.sh. --- diff --git a/posts/name-by-date/name-by-date.sh b/posts/name-by-date/name-by-date.sh index abfbc4c..a4784bc 100755 --- a/posts/name-by-date/name-by-date.sh +++ b/posts/name-by-date/name-by-date.sh @@ -28,7 +28,10 @@ while [ -n "$1" ]; do FILE=$1 TYPE=$(file "$FILE" | grep JPEG) if [ -n "$TYPE" ]; then - FIELD_NAME='Date and Time' + FIELD_NAME="$NAME_BY_DATE_FIELD_NAME" + if [ -z "$FIELD_NAME" ]; then + FIELD_NAME='Date and Time' + fi ASCII_DATE=$(exif -m -t "$FIELD_NAME" "$FILE") # 2010:07:02 08:36:20 if [ $? -ne 0 ]; then # use similar field, e.g. 'Date and Time (original)' FIELD=$(exif -m "$FILE" | grep "$FIELD_NAME" | head -n1)