紧急求救:各位大哥,我这样设置环境变量对了吗?谢谢!
请教:我是按照
http://blog.csdn.net/yousoft/archive/2004/08/07/67870.aspx
来设置的
它上面的要求是在主目录的下的 .profile 或 (.login )下修改
在.profile文件(如果你的shell是bash、ksh、zsh或者sh)中,添加下面这些行:
QTDIR=/usr/local/qt
PATH=$QTDIR/bin:$PATH
MANPATH=$QTDIR/man:$MANPATH
LD_LIBRARY_PATH=$QTDIR/lib:$LD_LIBRARY_PATH
export QTDIR PATH MANPATH LD_LIBRARY_PATH
但是我的主目录下没有 .profile 和 (.login ),
所以我在 ect/profile 下修改。
现在:
ect/profile 是:
# /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 [ $EUID = 0 ]; then
pathmunge /sbin
pathmunge /usr/sbin
pathmunge /usr/local/sbin
fi
pathmunge /usr/X11R6/bin after
"profile" 49L, 840C
我把它修改为:
# /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 [ $EUID = 0 ]; then
pathmunge /sbin
pathmunge /usr/sbin
pathmunge /usr/local/sbin
fi
QTDIR=/usr/local/qt
PATH=$QTDIR/bin:$PATH
MANPATH=$QTDIR/man:$MANPATH
LD_LIBRARY_PATH=$QTDIR/lib:$LD_LIBRARY_PATH
export QTDIR PATH MANPATH LD_LIBRARY_PATH
pathmunge /usr/X11R6/bin after
"profile" 49L, 840C
各位大哥
我修改对了吗?
修改后,是不是要reboot ?
谢谢! 你不用修改任何东西。在绝大多数主流发行版中,只要你安装了Qt开发包,这些环境变量都是自动设置好的。你可以直接用export看到现成的环境变量。
页:
[1]