title: Bash subshell input with variable number of subshells
body: <p>I want to <code>grep</code> lines from a variable number of log files and connect their outputs with <code>paste</code>. If I had a fixed number of outputs, I could do it thus:</p>
  
  <pre><code>paste &lt;(grep $PATTERN $FILE1) &lt;(grep $PATTERN $FILE2)
  </code></pre>
  
  <p>But is there a way to do this with a variable number of input files? I want to write a shell script whose arguments are the input files. The shell script should <code>paste</code> the grepped lines from ALL of them.</p>