How to Pass Parameters from QSub to Bash Script?

后端 未结 2 935
遇见更好的自我
遇见更好的自我 2021-01-04 02:48

I\'m having an issue passing variables to a Bash script using QSub.

Assume I have a Bash script named example. The format of example is the following:



        
2条回答
  •  野趣味
    野趣味 (楼主)
    2021-01-04 03:09

    Not sure which batch scheduler you are using but on PBSPro or SGE then submitting with qsub example.sh this is a test should do what you want.

    The Torque batch scheduler doesn't (AFAIK) allow passing command line arguments to the script this way. You would need to create a script looking something like this.

    #!/bin/bash
    
    echo $FOO
    

    Then submit it with a command like:

    qsub -v FOO="This is a test" example.sh
    

提交回复
热议问题