Hello,
this is my first post so i hope that am doint this right. I have a fairly simple problem, or it should be. I searched on google wasnt able to find an answer that i could understand. I am making a script to execute some common task on my linux servers and within the script i would like to identify the version of the os. I only use CentOS, and on red hat systems there is a file name /etc/redhat-release that contains the info i need. here is part of the code that is not working:
Code:
VERSION= cat /etc/redhat-release | awk '{print $3}'
if [ $VERSION > 5 ];then
echo "Centos version 4"
else
echo "Centos Version 5"
fi
I have, i think, identified part of the problem. The variable value is a string so i guess the logical test cannot work...and since i am not sure how to convert the value to an integer..
Thank you in advance.