# Has a distro file the specified word?
has()
{
[ -n "$DISTROFILE" ] || exit 1
grep "$*" "$DISTROFILE" >/dev/null 2>&1
}elif distro slackware-version ; then
DISTRIB_ID="Slackware"
if has 10.2 ; then DISTRIB_RELEASE="10.2"
elif has 11 ; then DISTRIB_RELEASE="11"
elif has 11.1 ; then DISTRIB_RELEASE="11.1"
elif has 12 ; then DISTRIB_RELEASE="12"
fi
Уверены, что сможете когда-нибудь получить DISTRIB_RELEASE="11.1"?
К слову, его такого и не было в природе.
Имелось в виду что-то вроде:
elif distro slackware-version ; then
DISTRIB_ID="Slackware"
if has 10.2 ; then DISTRIB_RELEASE="10.2"
elif has 11.0 ; then DISTRIB_RELEASE="11.0"
elif has 12.0 ; then DISTRIB_RELEASE="12.0"
elif has 12.1 ; then DISTRIB_RELEASE="12.1"
elif has 12.2 ; then DISTRIB_RELEASE="12.2"
elif has 13.0 ; then DISTRIB_RELEASE="13.0"
elif has 13.1 ; then DISTRIB_RELEASE="13.1"
elif has 13.37 ; then DISTRIB_RELEASE="13.37"
elif has 14.0 ; then DISTRIB_RELEASE="14.0"
fi
? Тогда было достаточно:
elif distro slackware-version ; then
DISTRIB_ID="Slackware"
DISTRIB_RELEASE="$(grep -Eo [0-9]+\.[0-9]+ /etc/slackware-version)"