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
}

No comments:

Post a Comment

I appreciate comments. Feel free to write anything you wish. Selected comments and questions will be published.