Sunday, May 15, 2011
2:31 PM

Checking if at least a Kernel Version is Runnig in Bash

kernelatleast() { # provide number like 2639
kver=$(uname -r|cut -d\- -f1|tr -d '.'| tr -d '[A-Z][a-z]')
kver=${kver:0:4}
if [ $1 -ge $kver ] ; then
return 0;
else
return 1;
fi
}

0 comments:

Post a Comment