linux导入函数包失败,使用qsub运行shellscript时出现apos;文件意外结束apos;和apos;错误导入函数定义apos;错误 中国服务器网...
我有以下的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)保存文件。
總結
以上是生活随笔為你收集整理的linux导入函数包失败,使用qsub运行shellscript时出现apos;文件意外结束apos;和apos;错误导入函数定义apos;错误 中国服务器网...的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 连接linux软件发复制文件过去,lin
- 下一篇: linux以非root身份运行,以非ro