title: Pull fields/attributes from lsof (Linux command line)
body: <p>With the recent move to Flash 10 (or maybe it was a distro choice), I and many others are no longer able to copy Flash videos from /tmp. I have, however, found a workaround in the following:</p>
  
  <p>First, execute:</p>
  
  <pre><code>lsof | grep Flash
  </code></pre>
  
  <p>which should return output like this:</p>
  
  <pre><code>plugin-co 8935    richard   16w      REG        8,1   4139180       8220 /tmp/FlashXXq4KyOZ (deleted)
  </code></pre>
  
  <p>Note: You can see the problem here....the /tmp file has the file pointer released.</p>
  
  <p>You are, however, able to grab the file by using the cp command thusly:</p>
  
  <pre><code>cp /proc/#/fd/# video.flv
  </code></pre>
  
  <p>where the 1st # is the process ID (8935) and the second if the next number (16, from 16w).</p>
  
  <p>Currently, this works, but it requires a few manual steps. To automate this, I figure I could pull the PID and the fd number and insert them dynamically into the cp command.</p>
  
  <p>My question is how do I pull the appropriate fields into variables? I know you can use $1, etc. for grabbing input arguments, but how do you retrieve outputs?</p>
  
  <p>Note: I could use <code>pidof plugin-container</code> to find the PID, but I still need the other number (since it tells which specific flash video to save).</p>