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 [gor...@cshl.edu]
Sent: Wednesday, March 27, 2013 1:56 PM
To: Ganote, Carrie L
Cc: galaxy-...@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-POSIX-Mode
 ).


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

___________________________________________________________
Please keep all replies on the list by using "reply all"
in your mail client.  To manage your subscriptions to this
and other Galaxy lists, please use the interface at:
  http://lists.bx.psu.edu/

To search Galaxy mailing lists use the unified search at:
  http://galaxyproject.org/search/mailinglists/

Reply via email to