Capturing the version of an OSX application via commandline

Note: this post was migrated from my old Tumblr-backed blog

I recently needed to capture the version of OSX components (application, bundle, quicktime components) via the commandline as part of some administration infrastructure I was building. After doing some research and experimentation, I came to the conclusion that it could best be built using PlistBuddy.

Here is the script that I built. I hope you find it as useful as I have: