linux导入函数包失败,使用qsub运行shellscript时出现'文件意外结束'和'错误导入函数定义'错误 中国服务器网...

我有以下的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

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

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脚本。 它产生了annonying

/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

就这样。

在/ usr / share / modulees / init / bash中注释掉了'export -f module'一行。

在正常的登录shell中,modules.sh将从profile.d调用,所以module命令可用。 在一个非登录shell中,就像一个应用程序包装脚本,它只是首先获取上述文件。

一般情况下,在采购上面的文件后的应用程序脚本,他们再次发出命令“模块加载应用程序/供应商/应用程序”,这意味着额外的采购。

由于某种原因,我不知道在每行的末尾添加分号解决了问题。

最有可能的原因是,如果添加分号有所不同,最好使用DOS行结尾(\ r \ n)而不是POSIX行结尾(\ r)保存文件。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值