Tool run on cluster returns error state on clean install
Hi all, I am trying to upgrade our instance to the newest dist but I get the following in stderr when I attempt to run Bowtie or BWA: PREFIX/subs/galaxy_31.sh: command substitution: line 7: syntax error near unexpected token `(' PREFIX/subs/galaxy_31.sh: command substitution: line 7: `diff -n <(printf "%s\n" "${LIST_BEFORE[@]}") <(printf "%s\n" "${LIST_AFTER[@]}") | tail -n +2' PREFIX/subs/galaxy_31.sh: command substitution: line 7: syntax error near unexpected token `(' PREFIX/subs/galaxy_31.sh: command substitution: line 7: `diff -n <(printf "%s\n" "${LIST_BEFORE[@]}") <(printf "%s\n" "${LIST_AFTER[@]}") | tail -n +2' The job is going to the cluster and coming back. The tool appears to run even with the weird error. Sometimes the results are even correct, but I can't use them due to the error state. Has anyone seen this error before? Sincerely, Carrie Ganote
Hello Carrie, Ganote, Carrie L wrote, On 03/27/2013 01:22 PM:
I am trying to upgrade our instance to the newest dist but I get the following in stderr when I attempt to run Bowtie or BWA:
PREFIX/subs/galaxy_31.sh: command substitution: line 7: syntax error near unexpected token `(' PREFIX/subs/galaxy_31.sh: command substitution: line 7: `diff -n <(printf "%s\n" "${LIST_BEFORE[@]}") <(printf "%s\n" "${LIST_AFTER[@]}") | tail -n +2' PREFIX/subs/galaxy_31.sh: command substitution: line 7: syntax error near unexpected token `(' PREFIX/subs/galaxy_31.sh: command substitution: line 7: `diff -n <(printf "%s\n" "${LIST_BEFORE[@]}") <(printf "%s\n" "${LIST_AFTER[@]}") | tail -n +2'
The job is going to the cluster and coming back. The tool appears to run even with the weird error. Sometimes the results are even correct, but I can't use them due to the error state. Has anyone seen this error before?
The immediate reason is that on your cluster, the shell (e.g. bash) runs in POSIX mode, and the "<()" construct isn't POSIX compatible. Consider the following: == $ bash -c "cat <(printf 'hello world\n')" hello world $ dash -c "cat <(printf 'hello world\n')" dash: 1: Syntax error: "(" unexpected $ bash --posix -c "cat <(printf 'hello world\n')" bash: -c: line 0: syntax error near unexpected token `(' bash: -c: line 0: `cat <(printf 'hello world\n')' $ /bin/sh -c "cat <(printf 'hello world\n')" /bin/sh: -c: line 0: syntax error near unexpected token `(' /bin/sh: -c: line 0: `cat <(printf 'hello world\n')' == The last case above (with "/bin/sh") is what you likely encounter, as "bash" when executed as "sh" turns POSIX on (detailed here: http://www.gnu.org/software/bash/manual/html_node/Bash-POSIX-Mode.html#Bash-... ). Couple of possible work-arounds: 1. Change the first line of your shell scripts from "/bin/sh" to "/bin/bash". 2. Add "set +o posix" to the beginning of your shell script, to disable POSIX. 3. Rewrite the script to be POSIX-complaint by writing the two lists to temporary files, then running "diff -n" on the files. -gordon
Hi Assaf, all, Thanks for the help, I was setting my environment with sh instead of bash, and calling from bash... I'm not sure I would have ever figured that one out on my own. Many, many thanks!! -Carrie ________________________________________ From: Assaf Gordon [gordon@cshl.edu] Sent: Wednesday, March 27, 2013 1:56 PM To: Ganote, Carrie L Cc: galaxy-dev@bx.psu.edu Subject: Re: [galaxy-dev] Tool run on cluster returns error state on clean install Hello Carrie, Ganote, Carrie L wrote, On 03/27/2013 01:22 PM:
I am trying to upgrade our instance to the newest dist but I get the following in stderr when I attempt to run Bowtie or BWA:
PREFIX/subs/galaxy_31.sh: command substitution: line 7: syntax error near unexpected token `(' PREFIX/subs/galaxy_31.sh: command substitution: line 7: `diff -n <(printf "%s\n" "${LIST_BEFORE[@]}") <(printf "%s\n" "${LIST_AFTER[@]}") | tail -n +2' PREFIX/subs/galaxy_31.sh: command substitution: line 7: syntax error near unexpected token `(' PREFIX/subs/galaxy_31.sh: command substitution: line 7: `diff -n <(printf "%s\n" "${LIST_BEFORE[@]}") <(printf "%s\n" "${LIST_AFTER[@]}") | tail -n +2'
The job is going to the cluster and coming back. The tool appears to run even with the weird error. Sometimes the results are even correct, but I can't use them due to the error state. Has anyone seen this error before?
The immediate reason is that on your cluster, the shell (e.g. bash) runs in POSIX mode, and the "<()" construct isn't POSIX compatible. Consider the following: == $ bash -c "cat <(printf 'hello world\n')" hello world $ dash -c "cat <(printf 'hello world\n')" dash: 1: Syntax error: "(" unexpected $ bash --posix -c "cat <(printf 'hello world\n')" bash: -c: line 0: syntax error near unexpected token `(' bash: -c: line 0: `cat <(printf 'hello world\n')' $ /bin/sh -c "cat <(printf 'hello world\n')" /bin/sh: -c: line 0: syntax error near unexpected token `(' /bin/sh: -c: line 0: `cat <(printf 'hello world\n')' == The last case above (with "/bin/sh") is what you likely encounter, as "bash" when executed as "sh" turns POSIX on (detailed here: http://www.gnu.org/software/bash/manual/html_node/Bash-POSIX-Mode.html#Bash-... ). Couple of possible work-arounds: 1. Change the first line of your shell scripts from "/bin/sh" to "/bin/bash". 2. Add "set +o posix" to the beginning of your shell script, to disable POSIX. 3. Rewrite the script to be POSIX-complaint by writing the two lists to temporary files, then running "diff -n" on the files. -gordon
participants (2)
-
Assaf Gordon
-
Ganote, Carrie L