I'm trying to write a bash script to process jpeg files and replace one IPTC4 tag, "Fixture Identifier," that I know all of them have in them, using Andreas Huggel's exiv2 command-line utility.
I confess to using the IPTC fields my own unique way, and I have been using "Fixture Identifier" (aka "Event" in MS Expression Media) as a 'refinement' on "Transmission Reference," to which for years I've been applying short, often catchy descriptive two- and three-word phrases to describe the content of the pictures.
Okay, enough background. Here's the code for the script so far. What I decided to do first was have the user type in the full filename, with extension when applicable, and have exiv2 return the Fixture ID tag as it was presently written in the file. I've been, for at least three and a half hours, using the same jpeg file as a test file. I happen to know that the value of 'FixtureID' in this file is "Bust-ing Out." What Im puzzled by is how nearly identical code can give back such un-identical information.
Pasted into rxvt, this code works:
exiv2 -PInv bv1329-014.jpg | grep 'FixtureId' | sed 's/^FixtureId[ ]*//'
Which means it answers back with both words in the FixtureID tag "Busting" and
"Out" (no quotes oc).
In the script I'm writing, the same code looks like this (employing a variable to be echo'd later)
oldf1=(`exiv2 -PInv $gfile | grep 'FixtureId' | sed 's/^FixtureId[ ]*//'`)
When the script is run, I only see "Busting" (nq).
What's missing? Or is there a better way to go about it?