请教各位:如何在rc.sysinit中获取内核版本号?

看到坛子里2.4升级2.6的帖子,为共用新旧内核,在rc.sysinit脚本中加了如下代码来判断内核版本,从而加载不同模块,但是在BASH下失败,请教各位如何才能正确获得内核版本号?

原代码如下:
#
# ----- KERNEL 2.6.x support ------
# This is for compatibility between kernel-2.4.x and kernel-2.6.x
#
UNAME=`uname -r`
KERNELVER=${UNAME:0:3}
if [ "$KERNELVER" = "2.6" ]; then
#
# This is kernel-2.6.x
#
.......
else
#
# This is kernel-2.4.x
#
......
fi