The following code returns: syntax error near
#!/bin/bash myprogram -i <(gunzip -c file.gz) -j <(gunzip -c file2.gz)
It seems it doesn't like brackets. How can I make this script work? If I run the same command for a Linux shell it works. It is when I try to run the script with the command inside that it fails. Do I need to protect brackets or so ??
The exact command line that works outside the script (command line) is:
kaiju -z 1 -a greedy -m 5 -s 70 -x \ -t /db/kaiju/nodes.dmp -f /db/kaiju/kaiju_db_nr_euk.fmi \ -i <(gunzip -c files/mapped_reads_to_extracted_marker_genes/1/1.1.1.bin.13.genes.fa.R1.fq.gz) \ -j <(gunzip -c files/mapped_reads_to_extracted_marker_genes/1/1.1.1.bin.13.genes.fa.R2.fq.gz)
Sorry for long line (kaiju is open source program for bioinformatics). Inside a script it fails with the error above
bash --version GNU bash, version 4.1.2(1)-release (x86_64-redhat-linux-gnu) Copyright (C) 2009 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
The way I'm running the script is
bash script.sh. I have run
chmod +x on the script also. Any idea how it should written then?