- Code: Select all
osguess() {
if test -f /etc/redhat-release
then
if egrep "9 " /etc/redhat-release > /dev/null
then
echo "rh9"
return 0
else
echo "linux"
return 0
fi
The egrep matches the "7.9 " and assumes it needs to execute for Red Hat 9. Of course this doesn't work on Red Hat / CentOS 7. The egrep needs modified to "e 9 " or "release 9 ".