使用qsub运行shellscript时出现"意外的文件结束"和"错误导入函数定义"错误

Nie*_*ein 11 linux shell cluster-computing qsub

我有以下shellcript:

#!/bin/sh
cd /sw/local/bin/
export LD_LIBRARY_PATH=/sw/local/lib:/usr/local/Trolltech/Qt-4.7.2/lib:$LD_LIBRARY_PATH
./FeatureFinderRaw -in /homes/JG-C1-18.mzML -out /homes/test_remove_after_use.featureXML -threads 20
Run Code Online (Sandbox Code Playgroud)

当我从我自己的命令行运行它时它工作正常,但是当我尝试这样做时:

qsub -q ningal.q -cwd -V -o /homes/queue.out -e /queue.err featureFind_C1-18_20t.sh 
Run Code Online (Sandbox Code Playgroud)

我收到以下错误:

/bin/sh: module: line 1: syntax error: unexpected end of file
/bin/sh: error importing function definition for `module'
./FeatureFinderRaw: error while loading shared libraries: libOpenMS.so: cannot open shared object file: No such file or directory
/bin/sh: module: line 1: syntax error: unexpected end of file
/bin/sh: error importing function definition for `module'
./FeatureFinderRaw: error while loading shared libraries: libQtWebKit.so.4: cannot open shared object file: No such file or directory
/bin/sh: module: line 1: syntax error: unexpected end of file
/bin/sh: error importing function definition for `module'
./FeatureFinderRaw: error while loading shared libraries: libQtWebKit.so.4: cannot open shared object file: No such file or directory
/bin/bash: module: line 1: syntax error: unexpected end of file
/bin/bash: error importing function definition for `module'
./FeatureFinderRaw: error while loading shared libraries: libQtWebKit.so.4: cannot open shared object file: No such file or directory
/bin/sh: module: line 1: syntax error: unexpected end of file
/bin/sh: error importing function definition for `module'
./FeatureFinderRaw: error while loading shared libraries: libQtWebKit.so.4: cannot open shared object file: No such file or directory
/bin/sh: module: line 1: syntax error: unexpected end of file
/bin/sh: error importing function definition for `module'
Run Code Online (Sandbox Code Playgroud)

我不明白为什么在使用qsub时会出现此错误,但在同一群集计算机上直接运行脚本时则不会.如何使用qsub运行脚本?

pli*_*aad 10

在使用的包装器脚本中也有此问题

qsub -shell no -b yes -cwd -V somescript.bash arg1 arg2 etc
Run Code Online (Sandbox Code Playgroud)

如果你用它来提交另一个bash shell脚本.它产生了annonying

/bin/sh: module: line 1: syntax error: unexpected end of file
/bin/sh: error importing function definition for `BASH_FUNC_module'
Run Code Online (Sandbox Code Playgroud)

(这是在CentOS 6.6上运行的Sun Grid Engine 211.11)通过简单地将以下内容放在包装脚本(而不是包装脚本)之上来解决问题:

unset module
Run Code Online (Sandbox Code Playgroud)

就这样.


小智 5

在/ usr / share / Modules / init / bash中,注释了'export -f module'行。

在普通的登录shell中,将从profile.d中调用modules.sh,以便使用module命令。在非登录外壳中,就像应用程序包装脚本一样,它只是首先获取上述文件。

通常,在采购了上述文件之后,在应用程序脚本中,它们会再次发出命令“模块加载应用程序/供应商/应用程序”,这意味着需要额外的采购。

参考::-http: //gridengine.org/pipermail/users/2011-November/002019.html