Does qsub pass command line arguments to my script?

。_饼干妹妹 提交于 2021-01-20 19:10: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?


回答1:


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.




回答2:


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.




回答3:


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.



来源:https://stackoverflow.com/questions/26487658/does-qsub-pass-command-line-arguments-to-my-script

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!