1#!/bin/bash 2 3kvers=$(uname -r) 4 5MAJOR=$(echo $kvers | awk -F. '{ print $1 }') 6MINOR=$(echo $kvers | awk -F. '{ print $2 }') 7SUBVR=$(echo $kvers | awk -F. '{ print $3 }' | awk -F- '{ print $1 }' | sed 's/[^0-9]*//g') 8 9maj_num=$(($MAJOR * 65536)) 10min_num=$(($MINOR * 256)) 11 12echo $(($maj_num + $min_num + $SUBVR)) 13