【求助】: source /etc/profile.d下的文件不正常

sh/bash/dash/ksh/zsh等Shell脚本
回复
piggy1983
帖子: 18
注册时间: 2007-06-04 18:07

【求助】: source /etc/profile.d下的文件不正常

#1

帖子 piggy1983 » 2011-02-27 21:32

最近给人装Linux Mint,发现source /etc/profile.d下的文件不正常,即我安装了intel的编译器,但是在这个位置建立文件source PATH/iccvars.sh intel64后,终端中环境变量没有更新(重启后)。

在其他发行版,如Archlinux中没有这个问题。


现在,想请大家帮助。应该怎么设置才正确。
tycable
帖子: 66
注册时间: 2011-01-01 8:14

Re: 【求助】: source /etc/profile.d下的文件不正常

#2

帖子 tycable » 2011-02-28 12:17

你要在 ~/.bashrc 或者 /etc/bash.bashrc 中加入

代码: 全选

if [ -f <FILE_LOCATION> ]; then
    source <FILE_LOCATION>
fi
[ ] 里的内容,请查看 man test。
Blog <http://ffb-all.com/>
Linux User #529415 with Linux Counter <http://counter.li.org/>
PGP keyID F73D6274 hkp://keyserver.ubuntu.com
回复