From a1ee5e4c865965e55e10884767d9c49c828792b7 Mon Sep 17 00:00:00 2001 From: Nicolas Boisselier Date: Fri, 31 Jul 2015 15:26:35 +0100 Subject: [PATCH] profile --- etc/profile | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/etc/profile b/etc/profile index 6964d3ca..89ddc1c4 100644 --- a/etc/profile +++ b/etc/profile @@ -3,9 +3,14 @@ # case "$BASH_SOURCE" in */*) path="${BASH_SOURCE%/*}";; *) path='.' ;; esac [ -e "$path/profile.d/functions" ] && . "$path/profile.d/functions" -NB_ROOT=$(realpath ${path}/..) +NB_ROOT=$(realpath ${path}/.. 2>/dev/null) unset path +if [ -z "$NB_ROOT" ]; then + unset NB_ROOT + return +fi + for i in ${NB_ROOT}/etc/profile.d/envs ${NB_ROOT}/etc/profile.d/aliases $NB_ROOT/etc/profile.d/*.sh; do [ -r "$i" ] && . "$i" done -- 2.47.3