########################################################################
# get Linux Distribution id and version from /etc/issue 
# and set it to $DISTVER
########################################################################
DVER=`grep release /etc/issue` # like as "Red Hat Linux release 9 (Shrike)"
if [ x"$DVER" = x ]; then      #not found
    echo "xegetdv:No distribution ID Line found from /etc/issue, assumed \"sw3\"."
    DID=sw3                    #my Slackware 
else
#   declare -a DVWORDS             # define array
#   DVWORDS=($DVER)                # assign to array
#sw3 dose not support array
    DVER=`echo $DVER`              #reduce space,drop top and tail space
    DIST=${DVER%% *}               #get distribution id(top word)
    VER=${DVER#*release }          #cut top "*release "
    VER=${VER%% *}                 #get ver(top word)
#   echo $DIST
#   echo $VER
#   case ${DVWORDS[0]} in
    case $DIST         in
#     Red*)    DID=rh${DVWORDS[4]}  ;;     #Red Hat
      Red*)    DID=rh$VER           ;;     #Red Hat
#     Turbo*)  DID=tb${DVWORDS[2]}  ;;     #TurboLinux release 6.0 WorkStation (Shiga)
      Turbo*)  DID=tb$VER           ;;     #TurboLinux release 6.0 WorkStation (Shiga)
      *)      echo "xegetdv:No distribution ID found from /etc/issue ( " $DVER " ),assumed \"rh9\"."
              sleep 2
              DID=rh9
    esac
fi
DISTVER=$DID
#echo $DID
