Re: Shell script to detect OS version
Re: Shell script to detect OS version
- Subject: Re: Shell script to detect OS version
- From: Joe Ridge <email@hidden>
- Date: Tue, 12 Jul 2005 21:21:03 -0400
highly related to what version of OS X you are running, is what
version of darwin you are running and you can get this with the uname
command. 10.4 runs on Darwin 8, and 10.3.9 at least runs on Darwin 7.
I'm not sure if there is a good way to get uname to return just the
major version of darwin, but you can get it with uname -r | sed s/\
\..*//
Hope that helps.
On Jul 12, 2005, at 8:35 PM, Chris Waldrip wrote:
I'm not a power programmer (Perl gives me a headache), and have a
passing knowledge of shell scripting.
I've got several installers that add icons to the Dock, for our
users in the field. While none of our users have been upgraded to
10.4 yet, I've already modified my scripts to convert the
dock.plist to xml, do a defaults write to add the info, and then
convert back to binary.
But the problem is that 10.3 errors on the plutil command (like
you'd expect) and 10.4 requires that command.
It looks like the best solution is to modify my shell script to run
one part of the script if it's a release prior to 10.4.0, and
another if its 10.4.0 or later. But there's the rub... I'm not
tuned into how to detect the OS version from bash.
Or!
Is there a way in Iceberg (btw, fantastic app Stépane) to run
different scripts based on OS version? I see that there's a way to
detect OS version from the Script requirements, but it's an all or
nothing approach (do run if, don't run if).
Suggestions?
-Chris Waldrip
DNG Systems Engineer
CNN Digital News Gathering
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Installer-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40umiacs.umd.edu
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Installer-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden