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