Does qsub pass command line arguments to my script?
Asked Answered
S

3

18

When I submit a job using

qsub script.sh

is $@ setted to some value inside script.sh? That is, are there any command line arguments passed to script.sh?

Scaly answered 21/10, 2014 at 13:14 Comment(0)
U
18

You can pass arguments to the job script using the -F option of qsub:

qsub script.sh -F "args to script" 

or inside script.sh:

#PBS -F arguments

This is documented here.

Unifoliate answered 22/10, 2014 at 17:35 Comment(3)
is there an example on how to use this argument inside the script, I need to create a folder with the -F argument name.Coomer
No option -F with PBSPro_13.1.2.163512.Reword
I gave a torque-specific answer because this question has a Torque label, and because I don't know much about PBSPro.Unifoliate
V
11

On my platform the -F is not available. As a substitute -v helped:

qsub -v "var=value" script.csh

And then use the variable var in your script. See also the documentation.

Vitrescent answered 26/1, 2018 at 12:58 Comment(0)
R
0

No. Just tried to submit a script with arguments before I answered and qsub won't accept it.

This won't be as convenient as putting arguments on the command line but you could possibly set some environment variables which you can have Torque export to the job with -v [var name} or -V.

Rawdon answered 21/10, 2014 at 17:49 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.