-# Functions to help us manage paths. Second argument is the name of the
-# path variable to be modified (default: PATH)
-pathremove () {
- local IFS=':'
- local NEWPATH
- local DIR
- local PATHVARIABLE=${2:-PATH}
- for DIR in ${!PATHVARIABLE} ; do
- if [ "$DIR" != "$1" ] ; then
- NEWPATH=${NEWPATH:+$NEWPATH:}$DIR
- fi
- done
- export $PATHVARIABLE="$NEWPATH"