Script to check Red hat Version

Script to check  Red  Hat version is 5 or 6 

a=’cat /etc/redhat-release | awk {‘print $7 }’cut -d “.” -f1 ‘

if [ “$a” -eq “6” ]

then

echo “This RHEL 6”

else

echo “This is RHEL 5”

fi

Leave a Reply

Your email address will not be published. Required fields are marked *