% 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.
Ed On Oct 14, 2007, at 9:29 AM, David Cantrell wrote:
Is there any simple way that people can think of to detect which major version of OS X my perl code is running on? ie whether it's 10.0, 10.1 etc, I don't care about the difference between 10.3.3 and 10.3.4. -- David Cantrell | Hero of the Information Age I caught myself pulling grey hairs out of my beard. I'm definitely not going grey, but I am going vain.