~mdw
/
profile
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'master' of git+ssh://metalzone.distorted.org.uk/~mdw/etc/profile
[profile]
/
dot
/
bash_profile
diff --git
a/dot/bash_profile
b/dot/bash_profile
index
a6015e9
..
513f754
100644
(file)
--- a/
dot/bash_profile
+++ b/
dot/bash_profile
@@
-19,7
+19,7
@@
cd $HOME
# --- Add elements to a path string ---
__mdw_addto () {
# --- Add elements to a path string ---
__mdw_addto () {
- local var=$1 val dir=$2 new=""
+ local var=$1 val dir=$2 new=""
change=nil
eval "val=\$$var"
shift 2
for i in "$@"; do
eval "val=\$$var"
shift 2
for i in "$@"; do
@@
-27,7
+27,7
@@
__mdw_addto () {
[ -d $i ] || continue
case "X$val" in
X)
[ -d $i ] || continue
case "X$val" in
X)
- val=$i
+ val=$i
change=t
continue
;;
X$i)
continue
;;
X$i)
@@
-43,13
+43,13
@@
__mdw_addto () {
val=${val%:$i}
;;
esac
val=${val%:$i}
;;
esac
- new=$new:$i
+ new=$new:$i
change=t
done
case $dir in
l) val=${new#:}:$val;;
r) val=$val$new;;
esac
done
case $dir in
l) val=${new#:}:$val;;
r) val=$val$new;;
esac
- export $var=$val
+ case $change in t) export $var="$val" ;; esac
}
# --- Set the path variable ---
}
# --- Set the path variable ---