1. Problem: distinguish between redhat and centos to get release number (such as centos6.5 "6.5", redhat" 7.3")
2. I tried to write a command: lsb_release-a | grep Release | awk"{print $2}"| awk-F. "{print $1 "." $2}"
but only for centos6.5,redhat6.5, while the redhat7.3,centos7.3,lsb_release command does not apply to
3. I also know that you can also use cat / etc/centos-release and cat / etc/redhat-release to check the release number
, but how do you distinguish between centos and redhat with the command? And get the release number
4. Just started to learn the script, is there any divine guidance, or other commands can also be implemented, thank you very much