Quote:
Originally Posted by patmut
Folks,
I'm writing a small script that should test RHEL version of a system (5.x or 6.x) and then execute a specific ation depending on the version. I'd like to test the condition on the fisrt numeric value to extract from 'cat /etc/redhat-release'. Does someone can help me with the command to extract this first numeric character (i.e. 5 or 6) and assign it to a variable?
|
What have you done/tried so far??? The best help would be for you to read bash scripting tutorials, which will give you help for this and MANY other scripting problems:
http://tldp.org/LDP/abs/html/
Some hints would be to read the man pages on the cut command.