From 89d9a0e123281c2e5dafbede9845672dea8c9c24 Mon Sep 17 00:00:00 2001 From: Nicolas Boisselier Date: Sun, 18 Aug 2019 06:11:58 +0100 Subject: [PATCH] /opt/nb/etc/profile --- etc/profile | 5 ++--- etc/profile.d/sys.sh | 3 +++ 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/etc/profile b/etc/profile index 993ebc46..c37391d3 100755 --- a/etc/profile +++ b/etc/profile @@ -124,9 +124,8 @@ nb_debug "NB_ROOT=$NB_ROOT" # NB 09.01.18 $(true || nb_repos_ls "etc/profile" "etc/profile.d/*.sh" | awk '!/^\/etc\// && $0 != "'${NB_ROOT}/etc/profile'"') \ if [ -n "$NB_ROOT" ]; then - alias which=which_cache + #alias which=which_cache nb_debug "PATH=$PATH" - #PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin for i in \ ${NB_ROOT}/etc/profile.d/envs \ ${NB_ROOT}/etc/profile.d/aliases \ @@ -140,7 +139,7 @@ if [ -n "$NB_ROOT" ]; then nb_debug ". $i" [ -r "$i" -a -f "$i" ] && . "$i" done - unalias which + #unalias which fi diff --git a/etc/profile.d/sys.sh b/etc/profile.d/sys.sh index 73028048..b565ac9f 100644 --- a/etc/profile.d/sys.sh +++ b/etc/profile.d/sys.sh @@ -153,6 +153,9 @@ sys_os() { . /etc/os-release && echo $ID $VERSION ) + elif which lsb_release > /dev/null; then + lsb_release --short -d + elif which sw_vers > /dev/null; then echo $(sw_vers 2>/dev/null | awk -F':\t' '/^(ProductName|ProductVersion)/{print $2}' | head -2) && return -- 2.47.3