From: Nicolas Boisselier Date: Tue, 11 Apr 2023 23:06:44 +0000 (+0200) Subject: sys_os X-Git-Url: https://git.nbdom.net/?a=commitdiff_plain;h=74aaefd3a40a034a5360fb9a6c0b02df312d22ba;p=nb.git sys_os --- diff --git a/etc/profile.d/sys.sh b/etc/profile.d/sys.sh index e7d633b3..893072e6 100644 --- a/etc/profile.d/sys.sh +++ b/etc/profile.d/sys.sh @@ -159,8 +159,7 @@ sys_activity() { sys_os() { if [ -e /etc/os-release ]; then - #( . /etc/os-release && echo $ID $VERSION ) - sh -c '. /etc/os-release && echo $ID $VERSION' + sh -c '. /etc/os-release && echo $NAME $VERSION' elif which lsb_release > /dev/null; then lsb_release --short -d @@ -169,8 +168,9 @@ sys_os() { echo $(sw_vers 2>/dev/null | \ awk -F':\t' '/^(ProductName|ProductVersion)/{print $2}' | head -2) + elif [ -e /etc/issue ]; then + sed -E -e 's/ \\[a-z]//g' -e '/^ *$/d' /etc/issue fi - #[ -r /etc/debian_version ] && echo Debian $(cat /etc/debian_version) }