Skip to main content

Ok, any script gurus here who can help us cobble together an Extension Attribute to capture and display the OS build number? Please point me to any existing method if I missed it. :)



Here's what we have:



$ system_profiler | grep "System Version: Mac OS X" | awk '{ print $6 $7 }'
2012-04-19 13:51:15.146 system_profiler[13331:60b] CFURLCreateWithString was passed this invalid URL string: '/System/Library/Image%20Capture/Devices/TWAINBridge.app' (a file system path instead of an URL string). The URL created will not work with most file URL functions. CFURLCreateWithFileSystemPath or CFURLCreateWithFileSystemPathRelativeToBase should be used instead.
10.7.3(11D50)


The very last part of the output is what we need...not sure what the goobleygook stuff is before it. Is there a better way to get the desired output (in this case "10.7.3(11D50)")? :)



TIA



Don

sw_vers
ProductName: Mac OS X
ProductVersion: 10.7.3
BuildVersion: 11D50


sw_vers -buildVersion



check the man page.


Yeah, 'sw_vers' is what i always use when looking to pull the OS and build info via a script. Forget system_profiler, too much overhead for just pulling that data.


@rockpapergoat Thanks...tested fine, the asset team sends their thanks!