Skip to content

Instantly share code, notes, and snippets.

@jhurliman
Created May 7, 2024 19:28
Show Gist options
  • Save jhurliman/ae71b06390acb8496711c77037303197 to your computer and use it in GitHub Desktop.
Save jhurliman/ae71b06390acb8496711c77037303197 to your computer and use it in GitHub Desktop.
Extract the NVIDIA Jetson L4T <RELEASE>.<MAJOR> version from /etc/nv_tegra_release
function get_L4T_major_version_only {
# Will return the L4T <release>.<major> version (ex: "32.6" or "32.4")
local RELEASE=$(cat /etc/nv_tegra_release | grep -oP "R\d{2}" | grep -oP "\d{2}")
local MAJOR_VERSION=$(cat /etc/nv_tegra_release | grep -oP "REVISION: \d{1}\.\d{1}" | grep -oP "\d{1}.\d{1}" | grep -oP "\d{1}". | grep -oP "\d{1}")
echo "${RELEASE}.${MAJOR_VERSION}"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment