Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Mac OS X > Q: Possible to get OSX version from shell?

Q: Possible to get OSX version from shell?
Thread Tools
Dedicated MacNNer
Join Date: Feb 2003
Status: Offline
Reply With Quote
Mar 1, 2005, 01:40 PM
 
I'd like to use the current OSX version in a shell script. Anyway of getting it? ie OS X 10.3.8?
Thanks.
     
Mac Elite
Join Date: Oct 1999
Location: San Jose, Ca
Status: Offline
Reply With Quote
Mar 1, 2005, 02:30 PM
 
Code:
uname -sr
will get you the Darwin Kernel version, and that can usually be translated to something useable with a table... Or you can do a bit more parsing you can use:
Code:
system_profiler -detailLevel -2
Note: I think that somewhere between 10.1 and 10.3 the name and output of this command chanced rather radically... but I don't have that information at my fingertips.
     
jgift  (op)
Dedicated MacNNer
Join Date: Feb 2003
Status: Offline
Reply With Quote
Mar 1, 2005, 02:54 PM
 
I just found it, thanks. Use: sw_vers

But I was having trouble with all the info in system_profiler and your tip is a great help in another script of mine. Thanks a lot!
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 09:45 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2