title: shell command to truncate/cut a part of string
body: <p>I have a file with the below contents. I got the command to print version number out of it. But I need to truncate the last part in the version file</p>
  
  <p>file.spec: </p>
  
  <pre><code>Version: 3.12.0.2
  </code></pre>
  
  <p>Command used:</p>
  
  <pre><code>VERSION=($(grep -r "Version:" /path/file.spec | awk  '{print ($2)}'))
  
  echo $VERSION
  </code></pre>
  
  <p>Current output : 3.12.0.2</p>
  
  <p><strong>Desired output : 3.12.0</strong></p>