From 128a7097e394a4e0825ec410567606d3dcf19ce9 Mon Sep 17 00:00:00 2001 From: Nicolas Boisselier Date: Fri, 20 Nov 2020 22:51:39 +0000 Subject: [PATCH] etc/profile --- etc/profile | 43 +++++++++++++++++++++++-------------------- 1 file changed, 23 insertions(+), 20 deletions(-) diff --git a/etc/profile b/etc/profile index 6add5492..e4b81234 100755 --- a/etc/profile +++ b/etc/profile @@ -68,27 +68,30 @@ elif [ "$KSH_VERSION" != "" ]; then #elif eval '[[ -n ${.sh.file} ]]' 2>/dev/null; then eval 'NB_ETC_DIR="$(dirname "${.sh.file}")"' -elif [ -r /etc/profile.d/nb.sh ]; then - # Already installed -# NB 18.02.19 NB_ETC_DIR=$(dirname $(grep '\. ' -m1 /etc/profile.d/nb.sh | cut -d'.' -f2 /etc/profile.d/nb.sh)) - NB_ETC_DIR=$(dirname "$(awk -F'&& . ' '/ \. /{print $2;exit}' /etc/profile.d/nb.sh)") - else - # Others - # We guess by looking for file !! - tmp=$PWD - for i in /*/*/etc/profile.d/nb.sh /*/*/*/etc/profile.d/nb.sh; do - - cd "$(dirname "$i")"/.. 1>/dev/null 2>&1 || continue - - # Look for this current file - [ -e profile ] && _nb_file_has_tag profile || continue - - NB_ETC_DIR=$PWD #|| unset NB_ETC_DIR - break - - done - cd "$tmp" +# NB 20.11.20: Unsupported + return 0 +# NB 20.11.20 elif [ -r /etc/profile.d/nb.sh ]; then +# NB 20.11.20 # Already installed + NB_ETC_DIR=$(dirname $(grep '\. ' -m1 /etc/profile.d/nb.sh | cut -d'.' -f2 /etc/profile.d/nb.sh)) +# NB 20.11.20 NB_ETC_DIR=$(dirname "$(awk -F'&& . ' '/ \. /{print $2;exit}' /etc/profile.d/nb.sh)") +# NB 20.11.20 +# NB 20.11.20 else +# NB 20.11.20 # Others +# NB 20.11.20 # We guess by looking for file !! +# NB 20.11.20 tmp=$PWD +# NB 20.11.20 for i in /*/*/etc/profile.d/nb.sh /*/*/*/etc/profile.d/nb.sh; do +# NB 20.11.20 +# NB 20.11.20 cd "$(dirname "$i")"/.. 1>/dev/null 2>&1 || continue +# NB 20.11.20 +# NB 20.11.20 # Look for this current file +# NB 20.11.20 [ -e profile ] && _nb_file_has_tag profile || continue +# NB 20.11.20 +# NB 20.11.20 NB_ETC_DIR=$PWD #|| unset NB_ETC_DIR +# NB 20.11.20 break +# NB 20.11.20 +# NB 20.11.20 done +# NB 20.11.20 cd "$tmp" fi -- 2.47.3