This is my script:
#!/bin/bash
set -x
arguments="some explanation"
if [[ $1 == -f ]]; then
    exiftool '-FileName<DateTimeOriginal' -d "%Y-%m-%d %H,%M,%S.%%e" "$2"
elif [[ $1 == -d ]]; then
    exiftool -d %Y-%m "-directory<datetimeoriginal" "$2"
elif [[ $1 == -fd ]]; then
    exiftool '-FileName<DateTimeOriginal' -d "%Y-%m-%d %H,%M,%S.%%e" "$2"
    exiftool -d %Y-%m "-directory<datetimeoriginal" "$2"
elif [[ $1 == -p ]]; then
    exiftool '-FileName<DateTimeOriginal' -d "%Y-%m-%d.%%e" "$2"
else
    echo -e $arguments
fi
set +x
If I run exifrename -f . it renames all files in the current folder. But let's say I have the following 3 files:
IMAG01234.jpg
IMAG01235.jpg
Ralph at home.jpg
and with them I run `exifrename -f IMAG*. It only renames one IMAG file.
When I debug this script, I see this:
+ [[ -d == -f ]]
+ [[ -d == -d ]]
+ exiftool -d %Y-%m '-directory<datetimeoriginal' IMAG01235.jpg
What can I do make the last line say IMAG* and not IMAG01235?
 
     
    