At the moment I'm using both uname and sw_vers

darwin_version=`uname -r`
osx_version=`sw_vers -productVersion`

But if I want to display the commercial name (Lion, Mountain Lion, Mavericks, ...) I have to manually maintain a list of osx version - commercial name pair.

I'd like to avoid that manual mapping and rely on system data. Is it possible ?

  • When I see commands like system_profiler SPSoftwareDataType I'm not sure it's really possible. – Matthieu Riegler Oct 30 '13 at 11:57
  • Yeah I've looked at system_profiler as well, and that got me desperate, that's why I'm asking here. But I fear too it's not possible. – Brice Oct 30 '13 at 12:19

Well as you said it : it's a commercial name and it's barely present in the OS it self. It no real wonder, it has no meaning for devs (far less than a version or a build number).

AFAIK It's mentioned in some help pages, but that's almost all.

So until someone would prove me wrong, there is no CLI for that (excluding curl stuff, which would imho not be a suitable option here).

| improve this answer | |
  • 1
    Yes that's what I fear! For the eycandy of my script I'd like to display the commercial name, I'm a bit sad there's isn't a property somewhere for that ;) – Brice Nov 3 '13 at 10:01
  • When I see the count of upvotes for your question (mine is included) you're not the only one ;) – Matthieu Riegler Nov 6 '13 at 10:24

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .