标签:span centos 12px family ror tool rgb false font
日常维护中,需要写个通用的执行shell,但是centos 6 版本与 7版本的诸多命令不同,需要程序自己判断,方法如下:1、查看cat /etc/centos-release
root@pts/0 # cat /etc/redhat-release|sed -r 's/.* ([0-9]+)\..*/\1/' 7 root@pts/15 # cat /etc/redhat-release|sed -r 's/.* ([0-9]+)\..*/\1/' 6
2、查看rpm -q centos-release
root@pts/0 # rpm -q centos-release|cut -d- -f3 7 root@pts/15 # rpm -q centos-release|cut -d- -f3 6
标签:span centos 12px family ror tool rgb false font
原文地址:http://blog.51cto.com/chaichuan/2069965