worm2004 发表于 2006-10-6 10:26:34

求助:linux 环境变量配置:

之后是tmake的配置,后面我们可以用它来生成pro工程文件和makefile文件。

先将下载的tmake解压缩,tar-zxvftmake-1.8.tar.gz
得到tmake-1.8目录,之后设置两个环境变量:PATH和TMAKEPATH
PATH=$PATH:/usr/src/tmake-1.8/bin
export PATH
TMAKEPATH=/usr/src/tmake-1.8/lib/linux-g++
export TMAKEPATH



请教:
上面是一段原文,我是这样配置的:
打开/etc/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 [ `id -u` = 0 ]; then
        pathmunge /sbin
        pathmunge /usr/sbin
        pathmunge /usr/local/sbin
fi

pathmunge /usr/X11R6/bin after

unset pathmunge

# No core files by default
ulimit -S -c 0 > /dev/null 2>&1

USER="`id -un`"
LOGNAME=$USER
MAIL="/var/spool/mail/$USER"

HOSTNAME=`/bin/hostname`
HISTSIZE=1000

if [ -z "$INPUTRC" -a ! -f "$HOME/.inputrc" ]; then
    INPUTRC=/etc/inputrc
fi

export PATH USER LOGNAME MAIL HOSTNAME HISTSIZE INPUTRC

for i in /etc/profile.d/*.sh ; do
    if [ -r "$i" ]; then
            . $i
    fi
done

unset i


然后我配置为:
# /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

unset pathmunge

# No core files by default
ulimit -S -c 0 > /dev/null 2>&1

USER="`id -un`"
LOGNAME=$USER
MAIL="/var/spool/mail/$USER"

HOSTNAME=`/bin/hostname`
HISTSIZE=1000

if [ -z "$INPUTRC" -a ! -f "$HOME/.inputrc" ]; then
    INPUTRC=/etc/inputrc
fi

export PATH USER LOGNAME MAIL HOSTNAME HISTSIZE INPUTRC

for i in /etc/profile.d/*.sh ; do
    if [ -r "$i" ]; then
            . $i
    fi
done

unset i
PATH=$PATH:/usr/src/tmake-1.8/bin
export PATH
TMAKEPATH=/usr/src/tmake-1.8/lib/linux-g++
export TMAKEPATH




然后保存退出

各位大哥,是这样配置的吗?
谢谢!

loveccy 发表于 2006-10-6 11:43:09

别随便改配置文件。
只在命令行上敲入就行了,是临时的,下次登入就没了。
页: [1]
查看完整版本: 求助:linux 环境变量配置: