摘要:
# /etc/profile
# System wide environment and startup programs, for login setup
# Functions and aliases go in /etc/bashrc
pathmunge () { #定义pathmunge函数,函数的作用是将一个路径添加到PATH变量中,如果PATH变量中已有此路径则不作操作
if ! echo $PATH | /bin/egrep -q "(^|:)$1($|:)" ; then
if [ "$2" = "after" ] ; then
PATH=$PATH:$1
else
PATH=$1:$PATH
fi
fi
} 阅读全文