title: bash - remove the last part of a string
body: <p>I want to know the ruby version being run from a bash script.</p>
  
  <p>That can be done with <code>ruby -v</code>:</p>
  
  <pre><code>$ ruby -v
  ruby 1.9.3p545 (2014-02-24) [i686-linux] Brightbox
  </code></pre>
  
  <p>My problem is that I just want the version number. How do I transform that output into this?</p>
  
  <pre><code>1.9.3p545
  </code></pre>