1 # switch PATH to new M2_HOME
4 # remove element from colon separated list
5 # usage: path_remove <pathvar> <pathelement>
6 eval path_removeP
="\"\$$1\""
7 path_removeP
=`(NP= S= IFS=: ; for P in $path_removeP; do [ "$P" = "$2" ] && continue; NP="$NP$S$P"; S=':'; done; echo "$NP")`
8 eval $1='"$path_removeP"'
9 eval [ "\"\$$1\"" ] ||
unset "$1"
14 path_remove PATH
"/opt/maven/bin"
15 path_remove PATH
"/opt/maven2/bin"
16 if [ "$M2_HOME" ]; then
17 path_remove PATH
"$M2_HOME/bin"
18 export PATH
=$M2_HOME/bin
:$PATH