[SOLVED] Save -d location in variable

Started by manup, June 16, 2023, 04:31:25 PM

Previous topic - Next topic

manup

Hi,

I'm using exiftool in a bash script to copy photos from a SD card (or a camera) to a specific folder like this:
origFolder="$photoRoot/%Y/%m - %B %y/%y%m%d$labelImport1"
exiftool -o . '-filename<CreateDate' -@ $licenseFile \
      -Keywords+="$labelImport" \
     -d "$origFolder/$labelImport2%y%m%d-%%f.%%e" \
     "$photoFile"

The thing is the destination folder, $origFolder, is in the end an exiftool encoded value which relies on the CreateDate of the input file $photoFile.

Now, after exiftool has moved the file (in fact the files since this sequence is in a loop), I'd need to cd to the real $origFolder where it's been copied.

Is there a way to achieve this? For instance in saving the -d value to some variable?

StarGeek

If I'm understanding you correctly, the only way to run exiftool with the -d and the -s (-short) option and capture that output

exiftool -d "$origFolder/$labelImport2%y%m%d-%%f.%%e" -s3 File.jpg

But you should know that running exiftool in a loop will significantly increase the processing time.  See Common Mistake #3.
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).

manup

Thanks @StartGeek, with the help of what you suggested I could sort it out.

I'm pretty sure running exiftool in a loop is less efficient in terms of performance, but the loop allows you to pipe some lines with a zenity --progress that is showing a progression bar I find interesting.

I don't know other way to do it.