You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

12 lines
492 B

#! /bin/bash
# this function prints the version number of the Linux distribution
# The version is retrieved from VERSION_ID="<version>" line in the /etc/*-release file
# If there is no VERSION_ID in this file then we fall back to extracting the name from lsb_release.
dist_ver="`cat /etc/*-release | grep VERSION_ID | cut -d '=' -f 2 | sed 's/[ "=]//g' | head -1`"
if [ -z "$dist_ver" ]; then
dist_ver="$(lsb_release -r | awk -F ':' '{print $2}' | awk '{print $1 }')"
fi
echo $dist_ver