Skip to content

Instantly share code, notes, and snippets.

@takaaki
Created December 22, 2009 01:48
Show Gist options
  • Save takaaki/261425 to your computer and use it in GitHub Desktop.
Save takaaki/261425 to your computer and use it in GitHub Desktop.
#!/bin/sh
# Get browser versions
# Prints version numbers of Safari and Firefox as well as OS X version number.
# by Takaaki Kato
# Partially stolen from http://episteme.arstechnica.com/eve/forums/a/tpc/f/8300945231/m/854004613931
# This script is dependent on the application location. Place apps under /Applications
# You can pipe the result to grep. For example `browsers | grep Firefox `
echo "Safari \c"
mdls -name kMDItemVersion "/Applications/Safari.app" | awk '{print substr($3,2,length($3)-2) }'
echo "Firefox \c"
mdls -name kMDItemVersion "/Applications/Firefox.app" | awk '{print substr($3,2,length($3)-2) }'
echo "Camino \c"
mdls -name kMDItemVersion "/Applications/Camino.app" | awk '{print substr($3,2,length($3)-2) }'
echo "Opera \c"
mdls -name kMDItemVersion "/Applications/Opera.app" | awk '{print substr($3,2,length($3)-2) }'
echo "Mac OS X \c"
sw_vers | grep ProductVersion | awk {'print $2'}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment