title: how to parse a string in Shell script
body: <p>I want to parse the following string in shell script.</p>
  
  <pre><code>VERSION=2.6.32.54-0.11.def
  </code></pre>
  
  <p>Here I want to get two value.</p>
  
  <pre><code>first = 263254
  second = 11
  </code></pre>
  
  <p>I am using following to get the first value:</p>
  
  <pre><code>first=`expr substr $VERSION 1 9| sed "s/\.//g" |sed "s/\-//g"`
  </code></pre>
  
  <p>to get the second:</p>
  
  <pre><code>second=`expr substr $VERSION 10 6| sed "s/\.//g" |sed "s/\-//g"`
  </code></pre>
  
  <p>Using above code the output is:</p>
  
  <pre><code>first=263254
  second=11
  </code></pre>
  
  <p>The result wont be consistent if version is changed to:</p>
  
  <pre><code>VERSION=2.6.32.54-0.1.def
  </code></pre>
  
  <p>Here second value will become 1d, but I want it give output of 1 only.</p>
  
  <p>How can I directly parse the number after '-' and before '.d'?</p>