I have run the following command on the command line and it works fine, but when I try running it from a shell script and run shell script from the terminal I get the following error:
join -t $'\t' -a1 -e "u" -1 1 -2 1 -o 1.1,2.1,2.2 file1 \
<(cat file2 | sort -k1,1|tr [:blank:] \\t ) | awk 'BEGIN {FS="\t";OFS="\t"}{if \($2 == "u")print $0, $1;else print $0, $3}' | awk '{gsub(/ /,"\t");l=$4; sub(/.*_/,"",l); print $2"\t"$3"\t"l}' > out
syntax error near unexpected token
('`
I have tried escaping the bracket but it still gives me the same error. I have many of these multi-layered commands in the script so I am sure this will be a problem in other parts, is there a way to solve this?
perl
was read-only.... – roaima Dec 4 '15 at 13:26awk: cmd. line:1: ^ backslash not last character on line
). Are you sure that you have provided the code you are really running? – roaima Dec 4 '15 at 13:28