]> err.no Git - dotfiles/commitdiff
add removepathelem and also explicitly remove "." from PATH for stupid
authortfheen <tfheen@8da78d58-1cd3-0310-bee5-d77bd1b3e8bf>
Sat, 18 Oct 2003 14:47:32 +0000 (14:47 +0000)
committertfheen <tfheen@8da78d58-1cd3-0310-bee5-d77bd1b3e8bf>
Sat, 18 Oct 2003 14:47:32 +0000 (14:47 +0000)
sites where that is added.

git-svn-id: file:///svn/tfheen/trunk/dotfiles@199 8da78d58-1cd3-0310-bee5-d77bd1b3e8bf

environment

index eaeeb32f55fba3f15d032924d91bdfca706a4e53..814559530bb9237a3b42fbfb3f02cd27ea815bd3 100644 (file)
@@ -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