Re: How to check Solaris version in a script?
- From: Sun_Powered <sun_powered@xxxxxxxxxxxxx>
- Date: Mon, 26 Jun 2006 02:27:26 -0500
Dan Foster wrote:
In article <449f70b2$0$9370$baae4c71@xxxxxxxxxxxxxxxxx>, Sun_Powered <sun_powered@xxxxxxxxxxxxx> wrote:
The uname command returns SunOS 5.1 (or some other number) but that doesn't tell me if it's Solaris 8, 9, or 10 on that machine.
I need to something that I can use in a script.
Sure thing. Here you go:
#!/bin/sh
# Get OS version
osver=`uname -r`
# Check OS version
if [ ${osver} = "5.8" ]; then
echo "Solaris 8"
elif [ ${osver} = "5.9" ]; then
echo "Solaris 9"
elif [ ${osver} = "5.10" ]; then
echo "Solaris 10"
else
echo "Unknown or unsupported OS version"
fi
# We're done, let user know this script completed successfully
exit 0
Modify as you need.
Thanks in advance!
You're welcome.
New to Solaris? Might want to read the Solaris FAQ here:
http://www.science.uva.nl/pub/solaris/solaris2.html
See the answer to question 1.5.
It has a table that lists Solaris version and its corresponding SunOS
version number (the uname -r output).
If you're new to Solaris, you *definitely* want to read the whole FAQ,
from start to finish... and re-read it as many times as you need to. It
helped me a lot 10 years ago.
-Dan
Thanks a lot for the script and the FAQ link, Dan!!
I'll be sure to read it. :)
.
- References:
- How to check Solaris version in a script?
- From: Sun_Powered
- Re: How to check Solaris version in a script?
- From: Dan Foster
- How to check Solaris version in a script?
- Prev by Date: Re: Staroffice 8 very very slow
- Next by Date: Re: Staroffice 8 very very slow
- Previous by thread: Re: How to check Solaris version in a script?
- Next by thread: Re: How to check Solaris version in a script?
- Index(es):
Relevant Pages
|