文章详情

  • 游戏榜单
  • 软件榜单
关闭导航
热搜榜
热门下载
热门标签
php爱好者> php文档>PATH环境变量的设置

PATH环境变量的设置

时间:2006-08-29  来源:xdev

系统级的环境变量在/etc/profile中进行设置,如加入“/usr/local/apache2/bin”这个路径条目,可以像如下设置:

# /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

相关阅读 更多 +
排行榜 更多 +
独角兽装扮物语

独角兽装扮物语

休闲益智 下载
多格和迷失的猫

多格和迷失的猫

休闲益智 下载
模拟赛车精英

模拟赛车精英

赛车竞速 下载