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

Re: [Condor-users] parsing arguments with whitespaces





Arguments=" -m var1 -p var2 -i 0.3 -s 0.5 -a 3.0 -n 1 -c \\\"1 2 3 4\\\""



Hi Peter.
I have just tried something like that, with condor-G version 7.0.2
This is my experience:

--------------------------------------------------------------------------------------------------

[1] with single quotes inside double qoutes:

    Arguments = "--opt1=value --opt2=\\\'hello world\\\' "

I have noticed that the second argument is converted into
 
    --opt2=\\\\\\hello world\\\\\InitialDir = /home/blah_blah_blah

Quite weird....

--------------------------------------------------------------------------------------------------

[2] with double quotes inside double quotes:

     Arguments = "--opt1=value --opt2=\\\"hello world\\\""

when trying to submit it I get this error message:


Unexpected characters following double-quote.  Did you forget to escape the double-quote by repeating it?  Here is the quote and trailing characters: "hello world\\\""
The full arguments you specified were: "--opt1=value --opt2=\\\"hello world\\\""

--------------------------------------------------------------------------------------------------

[3] I have tried to repeat the double-quote (driven by that error message):

      Arguments = "--opt1=value --opt2=\\\""hello world\\\"" "

and now the second argument is converted into

     --opt2=\\\\\\"hello world\\\\\\"

--------------------------------------------------------------------------------------------------

[4] So at the end I gave up with the \ , and decided to try just duplicated double quotes inside double quotes

    Arguments = "--opt1=value --opt2=""hello world"" "

and internally the second argument is converted into --opt="hello world"
which I think is what I need

--------------------------------------------------------------------------------------------------