Iptc utility syntax question

I just found and installed David Moore's libiptcdata with its iptc command-line utility. It's about the latter that my question is based.

The usage syntax is : iptc [OPTIONS] [FILE]...
where -m requires an IPTC field name, and -v is the value to assign or modify in that field. This value is a string bounded in double quotes. The thing I'm curious about (and as this little toy was written in 2005 I doubt Mr Moore is at his same email address as the one posted on his SourceForge manual page shows) is as follows:

How would one safely punctuate the value string, say, for a Caption or Special Instructions?

I've already tried an exclamation point, whereupon my bash shell reminded me that's a command in that shell (it noticed it even as it was in dbl-quotes). I suspect, then, that an alternate means of punctuation would have to be used. Having never installed or made any use of anything like this, I'm guessing it would either be the hex corresponding to the punctuation mark one wanted to represent, joined to the rest of the string by ampersand/s, or else an ampersand and another string containing the PM.
I suppose, also, that a hint or clue as to why would be in the C++ code in which this was written. Problem is, I don't know C++ well enough to know what to look for.

Could someone familiar with C++ coding download the libfiles (etc) and try to glean what the safer syntax would be to punctuate these strings [hex or &-signs between strings]?

Thanks for giving this a read.

BZT

A little trial and error, and a lot of scanning man, info and by-example Web pages later, I have:

Turns out it will pretty much comply with whatever your shell allows. You just have to format your strings according to the shell's syntax. If you happen to use a punctuation mark that your shell (eg bash) understands intuitively as a command (ye old bang <!> comes racing to mind), and you know how to isolate it/them so they're taken to be part of the string instead of as command shorthand, then this iptc tagger will glom onto that and use it as intended.

So after just now taken three sentences to say what could have been said in just one :rolleyes: I'll try to hunt down the link for downloading it and add it to an edit of this post sometime in the next 48hrs. Barring anything going wrong with my hardware, OS or net-access account.

BZT

Nice to see that folks working at the same problem from two different directions can run into the same brick wall and not know it.

I just ran both the Moore tool and exiv2 on a JPEG where the caption had several line breaks. Both tools ran one line over the other until the output for that particular field was a garbled mess.

Okay, it's likely David Moore has moved on to greener pastures. But what about Exiv2? I presume it's still being maintained and updated. Who should I let know about this (or ask and get their explanations as to why)?

In a way, it's no longer a question of syntax, but more a challenge to the coders in the audience: is it possible to do this thing better?

BZT

PS: The Moore tool is described on (and downloadable from) from this Sourceforge project page.