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

Re: [HTCondor-users] Windows batch file parameter with spaces



Update...

I've side stepped our problem with the environment variable, specifying

environment = "path='C:\WINDOWS\SYSTEM32;C:\Program Files\R\R-3.1.0\bin;C:\Program Files\R\R-3.1.1\bin;C:\Program Files\R\R-3.1.2\bin;C:\Program Files\R\R-3.1.3\bin'"

in the submit file. It is not a good solution, as a program with the same name can occur in multiple paths, but it solves the space-in-the-path problem for now. If anyone comes up with an answer to using a local variable that can be accessed with a $$(R_PATH) as per my question it would be appreciated.

Kind regards

Hannes

On 01/04/15 16:04, jcalitz wrote:
Hi

I'm trying to pass the path of Rscript, stored as a variable on the execution machine, as a parameter to a batch script.  The path is however split at the space when passed to the batch file.

On the execution node, the owner will have

HAS_R = True
R_PATH = "C:\Program Files\R\R-3.1.1\bin"
STARTD_ATTRS = HAS_R, R_PATH, $(STARTD_ATTRS)

On the submission machine, the submission file contains

Executable = run$$(OpSys).bat
transfer_input_files = test.R
arguments = $$(R_PATH) $(Process)

The batchfile runWINDOWS.bat is just a simple test script:

echo "A" %~f1
echo "B" %~dp1
echo "C" %~ftza1
echo "D %~1
echo "E %1

%~1%\Rscript.exe test.R %2
hostname

Output from the batchfile

"A" C:\Program\
"B" C:\Program\
"C" C:\Program\
"D C:\Program\
"E C:\Program\
HP345322

All solutions I found points to using %~1 to keep the path together.  Clearly not today. :)  Our current solution is to specify the version as well on the execute node, thus providing a way to check for the version and run a specific batch file (run$$(OpSys)$$(HAS_R_VER).bat .

Any ideas?

Kind regards

Hannes Calitz



_______________________________________________
HTCondor-users mailing list
To unsubscribe, send a message to htcondor-users-request@xxxxxxxxxxx with a
subject: Unsubscribe
You can also unsubscribe by visiting
https://lists.cs.wisc.edu/mailman/listinfo/htcondor-users

The archives can be found at:
https://lists.cs.wisc.edu/archive/htcondor-users/


-- 
Research Technician

 (o>  Room ScB3.32
 //\  www.massey.ac.nz/~jcalitz 
 V_/_