linux – 使用qsub运行shellscript的’意外的文件结束’和’错误导入功能定义’错误

前端之家收集整理的这篇文章主要介绍了linux – 使用qsub运行shellscript的’意外的文件结束’和’错误导入功能定义’错误前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我有以下 shellscript:
#!/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

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

qsub -q ningal.q -cwd -V -o /homes/queue.out -e /queue.err featureFind_C1-18_20t.sh

我收到以下错误

/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'

我不明白为什么在使用qsub时会收到此错误,但是在直接在同一个集群机器上运行脚本时却并不明白.如何使用qsub运行脚本?

解决方法

在使用的包装器脚本中也有这个问题
qsub -shell no -b yes -cwd -V somescript.bash arg1 arg2 etc

如果您使用它来提交另一个bash shell脚本.它产生了声音

/bin/sh: module: line 1: Syntax error: unexpected end of file
/bin/sh: error importing function definition for `BASH_FUNC_module'

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

unset module

就这样.

原文链接:https://www.f2er.com/linux/393626.html

猜你在找的Linux相关文章