I have a bash script that, when run on RHEL or OS X, gives the following error:
line 62484: syntax error near unexpected token `newline'
line 62484: ` -o_gz'
This is an auto-generated script to work around a limitation introduced by the grid engine compute cluster used in my company. It is all composed of a bunch of almost-identical if/elif
's. I can't see anything special with the line where the error comes from. When I run the beginning part of the script before the error line, it works without problems. This makes me think that there may be some bash script length limitation. The only reference I could find on the web was the comment by iAdjunct.
The part of the script around the error looks like this (with some simplifications):
.
.
.
.
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 \
-int \
98232182 \
99232182 \
-Ne \
20000 \
-o \
/some/other/output/file \
-verbose \
-o_gz
elif [ $task_number -eq 2501 ]
.
.
.
.
Does this ring any bells for anyone?