Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Simple example of how to get the VERSION_ID from /etc/os-release in a shell script
#!/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
You can’t perform that action at this time.