Skip to content

Instantly share code, notes, and snippets.

@tst32
Last active August 19, 2021 12:30
Show Gist options
  • Save tst32/197ee07212fc2e1785a8d62acee8cf1e to your computer and use it in GitHub Desktop.
Save tst32/197ee07212fc2e1785a8d62acee8cf1e to your computer and use it in GitHub Desktop.
get and export as variables all needed info for distro update repo string, call from .bashrc
#!/usr/bin/env bash
# get and export as variables distroname, codename, releasenum and arch all needed info for distro update repo string, call from .bashrc
export distro=`lsb_release -i 2>/dev/null|awk '{print $3}'`
export codename=`lsb_release -c 2>/dev/null|awk '{print $2}'`
export version=`lsb_release -r 2>/dev/null|awk '{print $2}'`
export arch=`dpkg --print-architecture`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment