On Oct 14, 2007, at 6:56 PM, David Cantrell <[EMAIL PROTECTED]>
wrote:
On Sun, Oct 14, 2007 at 10:45:30AM -0700, Edward Moy wrote:
% perl -e 'chomp($vers = `sw_vers -productVersion`); print "$vers\n"'
That will get you either 10.x or 10.x.y. You just need to strip off
the .y if it is there.
Perfect, thanks!
If for whatever reason that lets you down (e.g. trying to get the
version of a host you have mounted via AFP / NFS / Samba / etc), you
should also be able to poke in
/System/Library/CoreServices/SystemVersion.plist
which is basically the same info as sw_vers reports, but wrapped in XML.
--
Chris Devers