#!/bin/bash #No Warranty, distribute freely, suggestions and improved I appreciate to see :) #run the script recursive with find: # find $folder -type d -execdir exiv_user_comment '{}' ';' for i ; do #here with sed "ok ", "II " and "I" are being removed, which I use often at creating panorama pictures using autostitch #cut removes the first block of characters which is mostly SIMG[numbers] or dscf[numbers] or similiar z=`echo "$i" | cut -d " " -f 2- | sed -r -e 's/|II | helligkeit| heller| licht| helligk| nogain| no gain| gain| no straight| nostraighten|nostraight| no straighten| straighten| straight| tmp| bearb| to do| ok|I | rot|_rot|#|1 |2 |besser| cropped|crop| | |.jpg//g' ` exiv2 -vM"set Exif.Photo.UserComment $z" "$i"; done #from http://uk.groups.yahoo.com/group/exiv2/message/695?threaded=1&var=1&l=1&p=1, frostschutz at #gentoo-anfaenger (irc.freenode.org) and a little from my own grey cells :) #for i in *.jpg; do #exiv2 -kM"set Exif.Photo.UserComment ${i:9:$[${#i}-9-4]}" "$i"; #done ##!/bin/bash #orig von pazifi: #for i in *.jpg; do #b=${#i} #let b=$b-13 #z=`echo "${i:9:$b}"` #exiv2 -M"set Exif.Photo.UserComment $z" "$i"; #done