I have a test.sh
file which awks through a text file test.bed
:
1 31 431
1 14 1234
1 54 134
2 435 314
2 314 414
with
while read line;do
echo $line
# ... more code ... #
done < <(awk -F '\t' '$1 == 1 {print $0}' test.bed )
Running this with bash test.sh
works, but with sh test.sh
it gives syntax errors. How could I do the above using sh
instead of bash
?
The error that it gives is
test.sh: line 5: syntax error near unexpected token `<'
test.sh: line 5: `done < <(awk -F '\t' '$1 == 1 {print $0}' test.bed )'