title: Extract string between two characters in bash
body: <p>I have a string formatted as below </p>
  
  <pre class="lang-none prettyprint-override"><code>Walk Off the Earth - Somebody That I Used to Know
  [playing] #36/37   1:04/4:05 (26%)
  volume: n/a   repeat: off   random: on    single: off   consume: off
  </code></pre>
  
  <p>Now, from the above string I need to extract <code>36</code> from <code>#36/37</code>.</p>
  
  <p>First thing I did was to extract <code>#36/37</code> from second line using </p>
  
  <pre><code>echo "above mentioned string" | awk 'NR==2 {print $2}'
  </code></pre>
  
  <p>Now, I want to extract <code>36</code> from the above extracted part for that I did</p>
  
  <pre><code>echo `#36/37` | sed -e 's/\//#/g' | awk -F "#" '{print $2}'
  </code></pre>
  
  <p>which gave me <code>36</code> as my outptut.</p>
  
  <p>But, I feel that using both <code>sed and awk</code> just to extract text from <code>#36/37</code> is but of a overkill. So, is there any better or shorter way to achieve this.</p>