busy-bee.net buzz buzz buzz goes the honeybee home | blog | links | about me

linux to an imac

2002-06-12 15:31 / os version & sed  »

To get the version of OS X from the command line, type sw_vers (from mac os x hints). E.g.

 - dave@marnie - Wed 12 Jun 2002 13:56 BST - OSX 10.1.5/darwin5.2.2 -
 - 784/%:~- sw_vers 
ProductName:    Mac OS X
ProductVersion: 10.1.5
BuildVersion:   5S60

To extract from that the string '10.1.5', for use, e.g. in a prompt like the one above:

sw_vers | sed -n '/\([0-9]\.\)/s/.*:  //p'

That's a tab after the colon, and you'll have to type it manually rather than just copy and paste from this page.

mod_perl -- Speed, Power, Scalability