From bf64b0462c4ae41946fddfb6ad55b46f3d4b416f Mon Sep 17 00:00:00 2001 From: Alexander Barton Date: Fri, 18 Apr 2014 14:50:19 +0200 Subject: [PATCH] Unset temporary/local variables --- sys/profile | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/sys/profile b/sys/profile index 2e4f778..01251ef 100644 --- a/sys/profile +++ b/sys/profile @@ -51,21 +51,22 @@ else export PATH fi # prepend optional directories to PATH ... -path="" +unset path for d in /Developer/usr/bin /usr/pkg/bin /usr/ucb /usr/lib/ccache /opt/*/bin; do if [ -d "$d" -o -h "$d" ]; then [ -e "$d/.not_in_path" ] || path="$path$d:" fi done [ -n "$path" ] && PATH="$path$PATH" +unset path if [ "$LOGNAME" = "root" ]; then - path="" for d in /usr/pkg/sbin /opt/*/sbin; do if [ -d "$d" -o -h "$d" ]; then [ -e "$d/.not_in_path" ] || path="$path$d:" fi done [ -n "$path" ] && PATH="$path$PATH" + unset path fi # append optional directories to PATH ... for d in /usr/bin/X11 /usr/games /usr/share/php/bin; do @@ -73,6 +74,7 @@ for d in /usr/bin/X11 /usr/games /usr/share/php/bin; do [ -e "$d/.not_in_path" ] || PATH="$PATH:$d" fi done +unset d # set PATH so it includes user's private executables [ -d ~/Applications -a ! -e ~/Applications/.not_in_path ] \ && PATH=~/Applications:"${PATH}" @@ -92,6 +94,7 @@ if [ ! "$(type manpath 2>/dev/null)" ]; then [ -n "$path" ] && MANPATH="$path$MANPATH" [ -d ~/share/man ] && MANPATH=~/share/man:"${MANPATH}" [ -d ~/man ] && MANPATH=~/man:"${MANPATH}" + unset path d fi # set variable identifying the chroot you work in @@ -122,6 +125,7 @@ if [ -d /etc/profile.d -o -d /usr/local/etc/profile.d ]; then . "$f" esac done + unset f fi # read local profile, if available -- 2.39.2