system command with single quote characters in the string
James Flanagan
James at Flantec.com
Wed Jun 19 18:02:11 PDT 2013
I was hopeful that was the fix, but the three slashes did not work in place of the single slash. thanks,
James Flanagan
Flantec.com
email: James at Flantec.com
mobile: 760-458-8498
home: 219-221-6219
text: 7604588498 at txt.att.net
aim: Flantec
oovoo: Flantec
Skype: Flantec
ichat: Flantec at mac.com
home: 1901 Cidermill Road
Michigan City, IN 46360
On Jun 19, 2013, at 7:11 PM, Kenneth Brody <kenbrody at spamcop.net> wrote:
> On 6/19/2013 6:44 PM, James Flanagan wrote:
>> I am trying to send a unix command that requires " ' " (single quote
>> characters) to encapsulate the data that is being added as metadata in a
>> file. I have tried using the " \ " prior to each single quote character, and
>> if I msgbox the uc variable from the code below, the resulting command
>> appears perfect. however, when uc is actually run by the system command, the
>> single quotes do not appear to be translated properly because I get a
>> message on the screen that says" Error - File not Found - bedroom". That
>> tells me that the single quotes are not being respected to keep "master
>> bedroom" as a single string. Therefore, exiftool misinterprets bedroom as
>> the filename due to the space character between master and bedroom.
>>
>> I am using FilePro 5.7 on FreeBSD 9.0 p3.
>>
>> I am hopeful that there is an easy solution to this. thank you very much,
>>
>>
>> ::fn="/tmp/test.jpg":
>> ::va="master bedroom":
>> ::uc="/usr/local/bin/exiftool -q -iptc^AObjectName=\'"{va{"\'"<fn:
>> ::system noredraw uc:
>
> I'm not on a *nix box at the moment, but IIRC the problem is that you need
> to use a triple-backslash-quote in order for the shell to see backslash-quote.
>
> See, for example:
>
>
> http://stackoverflow.com/questions/13689738/keeping-double-quotes-when-passing-string-to-popen-in-c
>
> (Yes, it's an article about "popen" and not "system", but the same basic
> rules apply.)
>
> I believe you need:
>
> uc="/usr/local/bin/exiftool -q -iptc:ObjectName=\\\'"{va{"\\\'"<fn
>
> As I said, I'm not on a *nix box at the moment, so I can't test it, but it
> should be a simple test for you to try.
>
> --
> Kenneth Brody
> _______________________________________________
> Filepro-list mailing list
> Filepro-list at lists.celestial.com
> Subscribe/Unsubscribe/Subscription Changes
> http://mailman.celestial.com/mailman/listinfo/filepro-list
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.celestial.com/pipermail/filepro-list/attachments/20130619/5e62f6cc/attachment.html
More information about the Filepro-list
mailing list