[ To find os version ]
AIX | oslevel |
HP-UX | uname -r |
SunOS | uname -r |
Linux | if
[ -f /etc/system-release ] || [ -f /etc/redhat-release ] then # RedHat/CentOS/Oracle if [ -f /etc/system-release ] then RELEASE="/etc/system-release" else RELEASE="/etc/redhat-release" fi OS_VERSION=`cat ${RELEASE} | awk \ '{ if($1=="CentOS") print $1" "$3; else if($1=="Oracle") print $0; else print "Red Hat ES "$7; }'` else # SuSE OS_VERSION=`cat /etc/SuSE-release 2> /dev/null | grep VERSION | awk '{ print "SuSE "$NF }'` fi |
Windows | (wmic os get Caption | findstr /v "^$" | select -Last 1).Trim() |
No comments:
Post a Comment