Closed wdoekes closed 8 years ago
PRETTY_NAME="Debian GNU/Linux 7.0 (wheezy)"
NAME="Debian GNU/Linux"
VERSION_ID="7.0"
VERSION="7.0 (wheezy)"
ID=debian
ANSI_COLOR="1;31"
HOME_URL="http://www.debian.org/"
SUPPORT_URL="http://www.debian.org/support/"
BUG_REPORT_URL="http://bugs.debian.org/"
VERSION="14.04.4 LTS, Trusty Tahr"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 14.04.4 LTS"
VERSION_ID="14.04"
HOME_URL="http://www.ubuntu.com/"
SUPPORT_URL="http://help.ubuntu.com/"
BUG_REPORT_URL="http://bugs.launchpad.net/ubuntu/"
VERSION="16.04 LTS (Xenial Xerus)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 16.04 LTS"
VERSION_ID="16.04"
HOME_URL="http://www.ubuntu.com/"
SUPPORT_URL="http://help.ubuntu.com/"
BUG_REPORT_URL="http://bugs.launchpad.net/ubuntu/"
UBUNTU_CODENAME=xenial
PRETTY_NAME="Debian GNU/Linux 8 (jessie)"
NAME="Debian GNU/Linux"
VERSION_ID="8"
VERSION="8 (jessie)"
ID=debian
HOME_URL="http://www.debian.org/"
SUPPORT_URL="http://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"
$ grep -i trust /etc/os-release
VERSION="14.04.4 LTS, Trusty Tahr"
# grep wheez /etc/os-release
PRETTY_NAME="Debian GNU/Linux 7.0 (wheezy)"
VERSION="7.0 (wheezy)"
$ grep jess /etc/os-release
PRETTY_NAME="Debian GNU/Linux 8 (jessie)"
VERSION="8 (jessie)"
$ grep -i xenia /etc/os-release
VERSION="16.04 LTS (Xenial Xerus)"
UBUNTU_CODENAME=xenial
=>
sed -e '/^VERSION=/!d;s/^[^=]*="[^(,]*[(,] *\([A-Za-z]*\).*/\1/' /etc/os-release |
tr '[:upper:]' '[:lower:]'
https://github.com/systemd/systemd/commit/646b997c118e261c5ececc434dd40d0dbdbac4d8
=> future should have VERSION_CODENAME
It's the new way.