From: tfheen Date: Sat, 18 Oct 2003 14:47:32 +0000 (+0000) Subject: add removepathelem and also explicitly remove "." from PATH for stupid X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e0f9fe6481f4fc24a8acb9adad29d627171239fd;p=dotfiles add removepathelem and also explicitly remove "." from PATH for stupid sites where that is added. git-svn-id: file:///svn/tfheen/trunk/dotfiles@199 8da78d58-1cd3-0310-bee5-d77bd1b3e8bf --- diff --git a/environment b/environment index eaeeb32..8145595 100644 --- a/environment +++ b/environment @@ -17,16 +17,20 @@ is_debian () { return 1 } +removepathelem () { + PATH=$(echo "$PATH" | sed -e "s,:*$1:,:,g") +} + setpathifdir () { if [ -d "$1" ]; then - local NP=$(echo "$PATH" | sed -e "s,:*$1:,:,g") + removepathelem "$1" PATH="$1:$NP" fi } appendpathifdir () { if [ -d "$1" ]; then - local NP=$(echo "$PATH" | sed -e "s,:*$1:,:,g") + removepathelem "$1" PATH="$NP:$1" fi } @@ -117,6 +121,7 @@ case "$DOMAINNAME" in ;; esac +removepathelem "." export LS_OPTIONS CVSROOT EDITOR TZ WWW_HOME LESSOPEN LESS RSYNC_RSH export CVS_RSH PILOTPORT PILOTRATE LANG DEBEMAIL CVSEDITOR ldlib