title: Parse the output of command in a shell script and store the result in a variable
body: <p>When I execute the following <code>svn</code> command, I get the below output.</p>
  
  <pre><code>$ svn log -r 1:HEAD --limit 1 http://plugins.svn.wordpress.org/bulk-delete
  ------------------------------------------------------------------------
  r91525 | plugin-master | 2009-02-03 10:39:23 +0530 (Tue, 03 Feb 2009) | 1 line
  
  adding bulk-delete by sudar
  ------------------------------------------------------------------------
  </code></pre>
  
  <p>I am writing a shell script and I want to parse the output of the above command and get the revision number (r91525 in this case) and store it in a shell variable, so that I can use it in the subsequent commands.</p>
  
  <p>I tried the cut command and was able to get the revision number in the second line, but the other lines were still appearing.</p>
  
  <pre><code>$ svn log -r 1:HEAD --limit 1 http://plugins.svn.wordpress.org/bulk-delete | cut -f1 -d'|'
  ------------------------------------------------------------------------
  r91525 
  
  adding bulk-delete by sudar
  ------------------------------------------------------------------------
  </code></pre>
  
  <p>Question: How to retrieve the revision number and store in a shell variable, so that I can use it in the subsequent commands?</p>