I'm trying to write and overwrite jpg metadata with exiftool in a bash for-loop, but a specific command won't work in the loop. I want to overwrite the gpstimestamp with the datetimeoriginal data, this works if executed on the commandline, but not in the script..
for f in $(ls *.jpg); do
[... stuff that works]
exiftool "-gpstimestamp<datetimeoriginal" $f
done
Any ideas why this isn't working in the loop?
The for loop can be done in a simpler way:
#!/bin/bash
for f in *.jpg
do
[... stuff that works]
exiftool "-gpstimestamp<datetimeoriginal" $f
done
Note: You instead of running a for loop, you can execute
exiftool
to process all*.jpg
files in the directory using:
exiftool "-gpstimestamp<datetimeoriginal" -ext jpg .
-ext EXT (-extension) Process files with specified extension