title: How can I cut the version number out of a pom file in bash
body: <p>I have a pom file that has the following information:</p>
  
  <pre><code>&lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
    &lt;groupId&gt;com.site.camera&lt;/groupId&gt;
    &lt;artifactId&gt;proj3&lt;/artifactId&gt;
    &lt;packaging&gt;pom&lt;/packaging&gt;
    &lt;version&gt;2.6&lt;/version&gt;
    &lt;name&gt;Proj 3&lt;/name&gt;
  </code></pre>
  
  <p>I am writing a bash script and want to be able to open this file (pom.xml) and cut out the version (eg. 2.6 in this case). I am doing this because as I update the version I want the rest of my script to update with it.</p>
  
  <p>Things that I have tried:</p>
  
  <pre><code>var=$(grep &lt;version&gt;2.6&lt;/version&gt; pom.xml)
  echo $var
  </code></pre>
  
  <p>Note that I have multiple version parameters in the pom file. And I need this specific version which is surrounded with this name, packaging, artifactId etc. </p>