我有一个bash脚本,当在RHEL或OS X上运行时,会出现以下错误:
第62484行:意外标记'newline'附近的语法错误
第62484行:`-o_gz'
这是一个自动生成的脚本,用于解决我公司使用的Grid Engine计算群集引入的限制.它全部由一堆几乎相同if/elif的组成.我看不出错误来自哪一行有什么特别之处.当我在错误行之前运行脚本的开头部分时,它可以正常工作.这让我觉得可能有一些bash脚本长度限制.我在网上找到的唯一参考是iAdjunct的评论.
围绕错误的脚本部分看起来像这样(有一些简化):
.
.
.
.
elif [ $task_number -eq 2499 ]
then
/some/tool/executable \
-use_prephased_g \
-m \
/some/text/file \
-h \
/some/zipped/file \
-l \
-int \
45063854 \
46063853 \
-Ne \
20000 \
-o \
/some/output/file \
-verbose \
-o_gz #==============> ****THIS IS LINE 62484****
elif [ $task_number -eq 2500 ]
then
/some/tool/executable \
-use_prephased_g \
-m \
/some/other/text/file \
-h \
/some/other/zipped/file \
-l …Run Code Online (Sandbox Code Playgroud)