linux的/etc/profile文件在说啥呢?能删吗

# /etc/profile: system-wide .profile file for the Bourne shell (sh(1))
# and Bourne compatible shells (bash(1), ksh(1), ash(1), ...).
if [ -d /etc/profile.d ]; then
for i in /etc/profile.d/*.sh; do
if [ -r $i ]; then
. $i
fi
done
unset i
fi
if [ "$PS1" ]; then
if [ "$BASH" ]; then
PS1='\u@\h:\w\$ '
if [ -f /etc/bash.bashrc ]; then
. /etc/bash.bashrc
fi
else
if [ "`id -u`" -eq 0 ]; then
PS1='# '
else
PS1='$ '
fi
fi
fi
umask 022

最好不要删除,里面是的配置文件显示系统运行的环境为bash模式追问

我在做交叉编译,其中有一步这么做:(我没放到profile,我在profile.d下建了.sh)

报错:“fi”附近出现语法错误。

能讲讲代码是什么意思吗?我不懂pathmunge和PATH变量的关系

温馨提示:答案为网友推荐,仅供参考
第1个回答  2013-05-08
CD / etc / profile文件输入到文档编辑模式,然后vi的轮廓按我可以编辑。追问

我在做交叉编译,网上有人这么做的:

我把这段话加在proflie文件内容的后面,然后

4、 执行 source /etc/profile命令,使新的环境变量生效 

报错:bash:[1000:找不到命令

 是不是要把添加的内容放到/etc/profile.d的.sh文件里?

但是为什么原来这样就不对呢?

第2个回答  2013-06-04
不能删,里面是系统的初始化信息
第3个回答  2013-05-08
不能,尤其是PATH环境变量,不然你开不了机,登录不了,
第4个回答  2013-05-08
系统的配置文件,删了你就等着各种奇怪的问题出现吧

相关了解……

你可能感兴趣的内容

本站内容来自于网友发表,不代表本站立场,仅表示其个人看法,不对其真实性、正确性、有效性作任何的担保
相关事宜请发邮件给我们
© 非常风气网