title: Concatenate output of two commands into one line
body: <p>I have a very basic shell script here:</p>
  
  <pre><code>for file in Alt_moabit Book_arrival Door_flowers Leaving_laptop
  do
      for qp in 10 12 15 19 22 25 32 39 45 60
      do
          for i in 0 1
          do
              echo "$file\t$qp\t$i" &gt;&gt; psnr.txt
              ./command &gt; $file-$qp-psnr.txt 2&gt;&gt; psnr.txt
          done
      done
  done
  </code></pre>
  
  <p><code>command</code> calculates some PSNR values and writes a detailed summary to a file for each combination of <code>file</code>, <code>qp</code> and <code>i</code>. That's fine.</p>
  
  <p>The <code>2&gt;&gt;</code> outputs one line of information that I really need. But when executed, I get:</p>
  
  <pre><code>Alt_moabit  10  0
  total   47,8221 50,6329 50,1031
  Alt_moabit  10  1
  total   47,8408 49,9973 49,8197
  Alt_moabit  12  0
  total   47,0665 50,1457 49,6755
  Alt_moabit  12  1
  total   47,1193 49,4284 49,3476
  </code></pre>
  
  <p>What I want, however, is this:</p>
  
  <pre><code>Alt_moabit  10  0    total  47,8221 50,6329 50,1031
  Alt_moabit  10  1    total  47,8408 49,9973 49,8197
  Alt_moabit  12  0    total  47,0665 50,1457 49,6755
  Alt_moabit  12  1    total  47,1193 49,4284 49,3476
  </code></pre>
  
  <p>How can I achieve that?</p>
  
  <p>(Please feel free to change the title if you think there's a more appropriate one)</p>