From: Nicolas Boisselier Date: Fri, 31 Jul 2015 14:26:35 +0000 (+0100) Subject: profile X-Git-Url: https://git.nbdom.net/?a=commitdiff_plain;h=a1ee5e4c865965e55e10884767d9c49c828792b7;p=nb.git profile --- 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