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

Re: [HTCondor-users] String composite argument



For complex cases like this, you should not expect the -dry-run arguments to be the same as what the final arguments will be when the job is run.

 

The internal representation that Condor uses for arguments is designed to preserve spaces, and to be portable across Windows and Unix which have very different quoting rules.   Because of this, the way arguments are stored in a job classad does not match either Windows or Linux.  Instead the arguments are converted by the execute node to a form appropriate for OS the job is running on.

 

I think what you want to do here is to force the submit file to use the version 2 argument syntax by putting all of the arguments in double quotes. and then use single quotes around arguments that have imbedded spaces.

 

In your case it would look something like this.

 

E='do this && do thatâ

[â]

arguments   = "-d -r $(A) $(B) â $(E)"

or this


E=do this && do that

[â]

arguments   = "-d -r $(A) $(B) â '$(E)'"

If you want to verify that the result is quoted as you intended, you *cannot* look at the job classad, you must look at what is actually passed to your job when it runs on Linux.

 

I would suggest a dummy script that just prints out the arguments that are passed to it.

 

-tj

 

From: HTCondor-users <htcondor-users-bounces@xxxxxxxxxxx> On Behalf Of Michele Peresano
Sent: Monday, December 5, 2022 1:11 PM
To: HTCondor-Users Mail List <htcondor-users@xxxxxxxxxxx>
Subject: [HTCondor-users] String composite argument

 

Dear all,

 

I am trying to run an executable that in my home directory I would run like this,

 

bash script.sh -d -r A B C D âdo this && do thatâ

 

I tried both the old and new syntax as shown at

but probably I am doing some subtle mistake...

 

In my .sub file I am doing some parametrisation that works fine for all args, but the composite one.

 

A=bla

B=this_other_thing

[â]

 

I tried this (old syntax),

 

E='do this && do thatâ

[â]

arguments               = -d -r $(A) $(B) â $(E)

 

which from a dry run seems to work as I see

 

Args="-d -r content_A content_B â  âdo this && do thatâ â

 

but when submitting to the remote cluster my script debug prints show that argument E is equal to just 

 

âdo 

 

whereas from my home the same string of arguments when copy/pasted as it is above works as expected (i.e. E=âdo this && do thatâ).

 

I tried also this (new syntax)

 

E=""do this && do that""

[â]

arguments               =" -d -r $(A) $(B) â $(E)â

 

but this generates something like 

 

bash script.sh -d -r A B C D \"do this && do that\â

 

which of course make my program crash after "