Re: Shell script to detect OS version
Re: Shell script to detect OS version
- Subject: Re: Shell script to detect OS version
- From: Peter Bierman <email@hidden>
- Date: Tue, 12 Jul 2005 18:26:47 -0700
At 8:35 PM -0400 7/12/05, Chris Waldrip wrote:
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.
Since that's all you need to be different between the versions, why
not just trap and ignore the error from plutil?
plutil -convert xml1 file.plist
(modify plist)
plutil -convert binary1 file.plist
If the two plutil commands return errors, your script should continue
just fine, and the plist is probably already a text file in that case.
You can grab the output from the plutil command or send it to
/dev/null to prevent the errors from showing up in the installer log.
-pmb
_______________________________________________
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