Last active
September 18, 2018 11:42
-
-
Save dgdavid/254f3125e16b4321cfc36755b7f691b8 to your computer and use it in GitHub Desktop.
Simple example of how to get the VERSION_ID from /etc/os-release in a shell script
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# See https://www.freedesktop.org/software/systemd/man/os-release.html | |
version_id=$(grep "^ID=" /etc/os-release | cut -d'=' -f2 | tr -d '"') | |
echo $version_id |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment