Code:
cat /etc/*release
Red Hat Enterprise Linux Server release 5.8 (Tikanga)
cat /etc/*release
Red Hat Enterprise Linux ES release 4 (Nahant Update 9)
I want to extract just 5.8 or 4
I have used
Code:
cat /etc/*release | sed 's/\(.*\)\([0-9]\{1\}.?[0-9]\?\)\((.*)\)/\2/'
Code:
cat /etc/*release | sed 's/\(.*\)\([0-9]\{1\}.\?[0-9]\?\)\(.*\)/\2/'