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

Re: [Condor-users] Double quotes in a $$([...]) expression



Hi Mick,

Thanks for the input, but I'm afraid that submitting with that arguments line leads to the job being held, which condor_q -better says is because:

Hold reason: Cannot expand $$([strcat("-singleCompThread -nojvm -r test(1,"" , string(0), ")")]).

I should have said that I'm using version 7.6.9 under Linux.

Regards,
Mark

On 31/08/2012 15:05, Mick Timony wrote:
Hi Mark,

I think you may need to do this:

arguments = "$$([strcat(""-singleCompThread -nojvm -r test(1,"""" , string($(Process)), "")"")])"

The double-quotes at
 
    test(1,"", string ... 

is being submitted as 

    test(1,", string ...

as the two double-quotes imply that you want one of the quotes escaped which I presume is what you don't want to do.


For other reading this, the rules at http://research.cs.wisc.edu/condor/manual/v7.6/condor_submit.html say:


1. The entire string representing the command line arguments is surrounded by double quote marks. This permits the white space characters of spaces and tabs to potentially be embedded within a single argument. Putting the double quote mark within the arguments is accomplished by escaping it with another double quote mark.
2. The white space characters of spaces or tabs delimit arguments.
3. To embed white space characters of spaces or tabs within a single argument, surround the entire argument with single quote marks.
4. To insert a literal single quote mark, escape it within an argument already delimited by single quote marks by adding another single quote mark.

Regards.
--
Mick Timony
Scientific Web Services Developer
SBGrid Consortium - SBGrid.org
Harvard Medical School
--


On Fri, Aug 31, 2012 at 4:52 AM, Mark Calleja <mc321@xxxxxxxxx> wrote:
> Hi,
>
> I'm trying get double quotes to appear in an _expression_ in a submit file of
> the form:
>
> arguments = "$$([strcat("" ...  "")"")])"
>
> where the final result will be:
>
> arguments = -singleCompThread -nojvm -r "test(1,<the instantiation of
> $(Process)>)"
>
> However, try as I may I can't get those pesky double quotes to appear as
> literals. The best that I can get is with:
>
> arguments = "$$([strcat(""-singleCompThread -nojvm -r test(1,"" ,
> string($(Process)), "")"")])"
>
> which leads to:
>
> arguments = -singleCompThread -nojvm -r test(1,<the instantiation of
> $(Process)>)
>
> but any attempt to introduce literal double quotes in the argument string
> fails with the typical error message:
>
> "Unexpected characters following double-quote.  Did you forget to escape the
> double-quote by repeating it?"
>
> Any ideas for getting round this? I'll even settle for single quotes.
>
> Best regards,
> Mark