title: Take two at a time in a bash "for file in $list" construct
body: <p>I have a list of files where two subsequent ones always belong together. I would like a for loop extract two files out of this list per iteration, and then work on these two files at a time (for an example, let's say I want to just concatenate, i.e. cat the two files).</p>
  
  <p>In a simple case, my list of files is this:</p>
  
  <pre><code>FILES="file1_mateA.txt file1_mateB.txt file2_mateA.txt file2_mateB.txt"
  </code></pre>
  
  <p>I could hack around it and say</p>
  
  <pre><code>FILES="file1 file2"
  for file in $FILES
  do
      actual_mateA=${file}_mateA.txt
      actual_mateB=${file}_mateB.txt
  
      cat $actual_mateA $actual_mateB
  done
  </code></pre>
  
  <p>But I would like to be able to handle lists where mate A and mate B have arbitrary names, e.g.:</p>
  
  <pre><code>FILES="first_file_first_mate.txt first_file_second_mate.txt file2_mate1.txt file2_mate2.txt"
  </code></pre>
  
  <p>Is there a way to extract two values out of $FILES per iteration?</p>