1
我有以下的shell脚本命名dump.sh通字符串参数
#!/bin/sh
#$ -cwd
#$ -j y
#module load gcc octave
octave --eval "dumpoct($Nlay, $prefix);"
这个脚本加载倍频模块,然后评估以下倍频功能,它只是显示了两个输入参数
function dumpoct(arg1,arg2)
display(arg1)
display(arg2)
当我提交的shell脚本如下,它的工作原理(通过两个数字作为参数)
qsub -v Nlay=10,prefix=40 dump.sh
然而,当我与一个数一个字符串参数提交如下:
qsub -v Nlay=10,prefix="qwerty" dump.sh
我得到一个错误
error: `qwerty' undefined near line 0 column 13
error: evaluating argument list element number 2
我也曾尝试以下,我也得到了同样的错误
qsub -v Nlay=10,prefix='qwerty' dump.sh
qsub -v Nlay=10,prefix=qwerty dump.sh
任何想法我可以做到这一点?
谢谢
Giorgos
非常感谢!第一个解决方案有效。另外两个不起作用,因为它们实际上是作为输入传递给函数的:dumpoct(10,\“qwerty \”),它给出了八度误差 – giorgk 2013-03-17 03:35:48