I need a terminal command for finding an application's version number.
Hello,
I need a terminal command for finding the version number of an application installed in OS X. Right now I have this, which works but takes a long time:
system_profiler -detailLevel full
And that takes a few minutes to run, then produces a giant list of all System Profiler information, then I copy/paste it into TextEdit and search for the application's name, and the version number is below it. This is an example of what it looks like for each application listed:
iPhoto:
Version: 9.2.1
Last Modified: 10/27/11 10:05 AM
Kind: Intel
64-Bit (Intel): No
App Store: No
Location: /Applications/iPhoto.app
Basically, I need a terminal command in which I can include the application's name in the command, and then have it quickly return the version number. I assume this would include grep and regular expressions, but I don't know how to write them, and I don't even know if that terminal command I'm using is the most efficent way to do this. I need it to be fast because I'm going to be running it on hundreds of computers via Apple Remote Desktop. Thank you for any help you can provide.
-Mike
Mac Pro