[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Condor-users] condor_chirp - How to escape special characters in classads?

I assume this is on Unix?
---> Actually, on both Windows and Unix.

condor_chirp set_job_attr MyAttributes '"A String with spaces"'
---> Thanks for the tip. This worked perfectly (I just tried on Unix so
far but will try on Windows later). One thing I still can't do with this
is the following: Let's say I want that the MyAttributes classad has the
value '"foo" "bar"' (including the quotes). The problem now are the two
quotes around the space in the middle. I can again escape them like

condor_chirp set_job_attr MyAttributes '"foo\" \"bar"'

but in this case the classad contains the escape character \ as well.
When I don't use the escape character the classad is simply not set at
all. Is there a way how an arbitrary string can be copied to a classad
just as it is? Let's say I want to have something like this:

condor_chirp set_job_attr JobRdpShell '"C:\Program Files (x86)\RDPTools
\RDPsession.exe -f -s "my shell.exe"'

Where "C:\Program Files (x86)\RDPTools\RDPsession.exe -f -s "my
shell.exe" should be the value of the classad.
Thanks for your help!

Am Mittwoch, den 04.01.2012, 11:47 -0600 schrieb Greg Thain:
> On 01/02/2012 09:29 AM, Felix Wolfheimer wrote:
> > I'm trying to use condor_chirp to set a job classad which contains a
> > lot of spaces quotes and stuff. I found out, that I can escape the
> > outer quotes and something like this:
> I assume this is on Unix?
> The value of a classad string attribute must be surrounded by double 
> quotes.  Otherwise, classads treats the value as a classad expression, 
> and you get very different behavior than expected.  So, you want the 
> value in double quotes.  Now, you can't just put it in double quotes as 
> you'd like, because the shell eats them.  You were on the right track by 
> escaping the quotes from the shell, bu the problem there is that the 
> shell treats the space as an argument separator, and the the 
> condor_chirp command then sees the wrong number of arguments.  So,  try 
> this:
> condor_chirp set_job_attr MyAttributes '"A String with spaces"'
> -greg
> _______________________________________________
> Condor-users mailing list
> To unsubscribe, send a message to condor-users-request@xxxxxxxxxxx with a
> subject: Unsubscribe
> You can also unsubscribe by visiting
> https://lists.cs.wisc.edu/mailman/listinfo/condor-users
> The archives can be found at:
> https://lists.cs.wisc.edu/archive/condor-users/