How to iterate over each output of awk with sh?
<p>I have a <code>test.sh</code> file which awks through a text file <code>test.bed</code>:</p>

<pre><code>1   31  431
1   14  1234
1   54  134
2   435 314
2   314 414
</code></pre>

<p>with</p>

<pre><code>while read line;do
    echo $line  
    # ... more code ... #
done &lt; &lt;(awk -F '\t' '$1 == 1 {print $0}' test.bed )
</code></pre>

<p>Running this with <code>bash test.sh</code> works, but with <code>sh test.sh</code> it gives syntax errors. How could I do the above using <code>sh</code> instead of <code>bash</code>?</p>

<hr>

<p>The error that it gives is </p>

<pre><code>test.sh: line 5: syntax error near unexpected token `&lt;'
test.sh: line 5: `done &lt; &lt;(awk -F '\t' '$1 == 1 {print $0}' test.bed )'
</code></pre>