syntax error near unexpected token `)'

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

syntax error near unexpected token `)'

konika
Hi
i am new to make file and trying to figure out how to write the command so I dont get the error:- syntax error near unexpected token `)'

Its very basic one line
(echo -n "Total "; zcat ../raw/shNuak1-D704_S4_L001_R1_001_sample.fastq.gz| echo -n $((`wc -l`/4)); ) > test.stats

it works fine on its own in shell
but in make file

%.stats: %.int %.sam
        (echo -n "Total "; zcat ../raw/shNuak1-D704_S4_L001_R1_001_sample.fastq.gz| echo -n $((`wc -l`/4)); ) > test.stats

it gives the error
/bin/bash: -c: line 0: syntax error near unexpected token `)'
/bin/bash: -c: line 0: `(echo -n "Total "; zcat ../raw/shNuak1-D704_S4_L001_R1_001_sample.fastq.gz| echo -n ); ) > test.stats'
make: *** [shNuak1-D704_S4_L001_R1_001_sample.stats] Error 1

Any ideas how to fix it?
Reply | Threaded
Open this post in threaded view
|

Re: syntax error near unexpected token `)'

konika
My supervisor fixed it by adding an extra $ sign :)
%.stats: %.int %.sam
        (echo -n "Total "; zcat ../raw/shNuak1-D704_S4_L001_R1_001_sample.fastq.gz| echo -n $$((`wc -l`/4)); ) > test.stats