function pathmunge { if ! echo $path | grep -qE "(^|:)$1($|:)" then if [[ "$2" = "after" ]] { path=(${path} $1) } else { path=($1 $path) } fi }