title: How to return app version in terminal on osx
body: <p>I am needing to use app version in a .sh script on Mac osX 10.10 so that I can do a compare to another number so I can force an update or not.</p>
  
  <p>So far I have this (I am using Firefox.app as an example)</p>
  
  <pre><code>FirefoxmdlsVersion= mdls -name kMDItemVersion /Applications/Firefox.app;
  echo $FirefoxmdlsVersion
  </code></pre>
  
  <p>This returns <code>kMDItemVersion = "34.0"</code>which is a step in the right direction but I need just the number so that I can do my compare example <code>340</code></p>
  
  <p>Here is what I have attempted to do with a new variable but I dont get an error or output at all</p>
  
  <pre><code>FFV2=${FirefoxmdlsVersion//'kMDItemVersion ='}
  FFV3=${FirefoxmdlsVersion:18:4}
  </code></pre>
  
  <p>I maybe going in the wrong direction here, but Ive looked a post and havent made any progress.  Can anyone help me?</p>