[TriLUG] detecting kernel major/minor versions

Joseph Mack NA3T jmack at wm7d.net
Mon Jun 26 20:53:20 EDT 2006


On Mon, 26 Jun 2006, Joseph Mack NA3T wrote:

> The current kernel version is 2.6.17.1. The extra place has broken my scripts 
> for detecting kernel major (${KVER%.*}) and minor (${KVER##*.}) versions. 
> Does anyone have a way that will work for a x.x.x.x AND a x.x.x kernel 
> number?

answering my own question

uname_r=`uname -r`
minor_and_subminor=${uname_r##*2.6.}
minor=${minor_and_subminor%\.*}

if [ `expr $uname_r : 2.6` = "3" ]
then
   if [ $minor -ge 13 ]
   then

...

Joe

-- 
Joseph Mack NA3T EME(B,D), FM05lw North Carolina
jmack (at) wm7d (dot) net - azimuthal equidistant map
generator at http://www.wm7d.net/azproj.shtml 
Homepage http://www.austintek.com/ It's GNU/Linux!



More information about the TriLUG mailing list