Open sskras opened 3 months ago
Eg. on Void Linux the current solution generates:
root@void-g:~# echo `uname -o | sed 's|/|-|'`-`uname -r | sed 's|/|-|g'` GNU-Linux-6.6.37_1
Using /etc/os-release might improve things nowadays:
/etc/os-release
root@void-g:~# lsb_release -d Description: Void Linux root@void-g:~# lsb_release -a LSB Version: 1.0 Distributor ID: VoidLinux Description: Void Linux Release: rolling Codename: void root@void-g:~# . /etc/os-release 2>/dev/null && echo "$PRETTY_NAME" Void Linux root@void-g:~# cat /etc/os-release NAME="Void" ID="void" PRETTY_NAME="Void Linux" HOME_URL="https://voidlinux.org/" DOCUMENTATION_URL="https://docs.voidlinux.org/" LOGO="void-logo" ANSI_COLOR="0;38;2;71;128;97" DISTRIB_ID="void"
This might help too: https://stackoverflow.com/questions/394230/how-to-detect-the-os-from-a-bash-script
Documented in https://github.com/sskras/.files/compare/d8b8678...34923c1.
Eg. on Void Linux the current solution generates:
Using
/etc/os-release
might improve things nowadays: