系统级的环境变量在/etc/profile中进行设置,如加入“/usr/local/apache2/bin”这个路径条目,可以像如下设置:
[code]# /etc/profile
# System wide environment and startup programs, for login setup
# Functions and aliases go in /etc/bashrc
pathmunge () {
        if ! echo $PATH | /bin/egrep -q "(^|:)$1($|:)" ; then
           if [ "$2" = "after" ] ; then
              PATH=$PATH:$1
           else
              PATH=$1:$PATH
           fi
        fi
}
# Path manipulation
if [ `id -u` = 0 ]; then
        pathmunge /sbin
        pathmunge /usr/sbin
        pathmunge /usr/local/sbin
fi
pathmunge /usr/X11R6/bin after
# HiWei Path
pathmunge /usr/local/apache2/bin[/code]
                  	
				

samblue 于 2006-08-30 13:28:58发表:
收下了,谢谢