以qsub开头的shell脚本的参数 [英] parameter for shell scripts that is started with qsub

查看:405
本文介绍了以qsub开头的shell脚本的参数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何参数化在网格上执行的shell脚本(以qsub开头)?我有一个shell脚本,在这里我使用getopts来读取参数.

how can I parametrize a shell script that is executed on a grid (started with qsub) ? I have a shell script, where I use getopts to read the parameters.

当我启动(qsub script.sh -r firstparam -s secondparam ..)时,这个带有qsub的工作脚本会收到错误消息,

When I start (qsub script.sh -r firstparam -s secondparam ..) this working script with qsub I receive error messages,

qsub:无效选项-s

qsub: invalid option -- s

qsub:非法的-r值

qsub: illegal -r value

如qsub认为参数本身就是

.但是我还没有找到任何解决方案.

as qsub thinks the parameter are for itself. Yet I have not found any solution.

谢谢

推荐答案

我刚刚想出了解决方法:只需使用echo命令打印shell脚本的命令,然后将结果通过管道传递给qsub:

I just figured out how to solve it: just print the commands of the shell scrip with echo and pipe the result to qsub:

echo "./script.sh var1=13 var2=24" | qsub

这篇关于以qsub开头的shell脚本的参数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆