title: piping files from tar to a command
body: <p>I need to untar a multiple-file archive. And I have to use a binary to do the actual writing.</p>
  <p>With a single file archive, I'm happy with</p>
  <pre><code>tar -Oxvf singlefile.tgz | writer filename
  </code></pre>
  <p>for multiple files, tar has a <code>--to-command</code> option that pipes each file to a specified command. Sounds good but what about the file names?</p>
  <pre><code>&gt;tar xvf test.tgz --to-command='writer' 2&gt; /dev/null
  tets1
  test2
  test3
  </code></pre>
  <p><code>tar</code> seems to output the filenames to its stdout, and I couldn't find a way to get the filenames within the command.</p>
  <p>Any ideas?</p>