The output from exif
looks like this:
ExifMnoteCanon: Loading entry 0xcf27 ('(null)')...
ExifMnoteCanon: Loading entry 0x3ca8 ('(null)')...
ExifMnoteCanon: Loading entry 0xf88a ('(null)')...
2013:08:22 18:01:16
In my bash script, I store this in a variable:
datetime="$(exif --debug --machine-readable --tag=DateTimeOriginal "$file" 2>&1)"
I want to extract the last line of this using bash parameter substitution. I thought this would work:
datetime="${datetime##*\n}"
But the output is then:
ull)')...
2013:08:22 18:01:16
Why doesn't this work and how can I fix it?