[root@localhost ~]# cat uname.sh#!/bin/bashmain=`uname -r | awk -F . \'{print $1}\'`minor=`uname -r | awk -F . \'{print $2}\'`if [ \"$main\" -eq 3 ] && [ \"$minor\" -ge 10 ]thenecho \"main version is :$mainminor version is :$minor\"elseecho \"main version is not 3\"fi
[root@localhost ~]# uname -r3.10.0-1062.el7.x86_64
[root@localhost ~]# sh vsftpd.shmain version is :3minor version is :10
脚本测试无误,可以使用