]> err.no Git - dotfiles/commitdiff
fix setpathifdir and appendpathifdir
authortfheen <tfheen@8da78d58-1cd3-0310-bee5-d77bd1b3e8bf>
Sat, 18 Oct 2003 14:45:31 +0000 (14:45 +0000)
committertfheen <tfheen@8da78d58-1cd3-0310-bee5-d77bd1b3e8bf>
Sat, 18 Oct 2003 14:45:31 +0000 (14:45 +0000)
git-svn-id: file:///svn/tfheen/trunk/dotfiles@198 8da78d58-1cd3-0310-bee5-d77bd1b3e8bf

environment

index c97490cd909b4880fe94f5f1bd989fa1e53a15b0..eaeeb32f55fba3f15d032924d91bdfca706a4e53 100644 (file)
@@ -19,13 +19,15 @@ is_debian () {
 
 setpathifdir () {
     if [ -d "$1" ]; then
-        PATH="$1:${PATH%$1}"
+        local NP=$(echo "$PATH" | sed -e "s,:*$1:,:,g")
+        PATH="$1:$NP"
     fi
 }
 
 appendpathifdir () {
     if [ -d "$1" ]; then
-        PATH="${PATH%$1}:$1"
+        local NP=$(echo "$PATH" | sed -e "s,:*$1:,:,g")
+        PATH="$NP:$1"
     fi
 }