Plan 9 from User Space's /usr/local/plan9/bin/osxvers

#!/bin/sh

u=`uname`
case "$u" in
Darwin)
	sw_vers | awk '$1 == "ProductVersion:" {print $2}' | awk -F. '{printf("CFLAGS=$CFLAGS -DOSX_VERSION=%d%02d%02d\n", $1, $2, $3)}'
esac

Space Glenda

Copyright © 2005 Lucent Technologies, Russ Cox, MIT.
See license for details.