[讨论]奇怪bash_profile没有自动执行

系统安装、升级讨论
版面规则
我们都知道新人的确很菜,也喜欢抱怨,并且带有浓厚的Windows习惯,但既然在这里询问,我们就应该有责任帮助他们解决问题,而不是直接泼冷水、简单的否定或发表对解决问题没有任何帮助的帖子。乐于分享,以人为本,这正是Ubuntu的精神所在。
回复
BooBio
帖子: 4
注册时间: 2007-10-04 21:11

[讨论]奇怪bash_profile没有自动执行

#1

帖子 BooBio » 2007-11-10 16:41

我在~/.bash_profile和~/.bashrc下面加了一些个人的设置,重启以后居然没有生效。查了半天,发现没有.bash_profile居然没有被执行。

我是7.10版本的。哪位达人指点一下,ubuntu下不执行该脚本么?难道非要放到root用户的.profile中不成?
Wang Lei
帖子: 214
注册时间: 2007-07-16 21:42

#2

帖子 Wang Lei » 2007-11-10 17:08

When bash is invoked as an interactive login shell, or as a non-interactive shell with the --login option, it first
reads and executes commands from the file /etc/profile, if that file exists. After reading that file, it looks for
~/.bash_profile, ~/.bash_login, and ~/.profile, in that order, and reads and executes commands from the first one
that exists and is readable.

如果BASH被作为LOGIN shell使用,会按顺序读取:
/etc/profile
~/.bash_profile
~/.bash_login
~/.profile

我是加在~/.profile和~/.bash_profile中的
HP Compaq 6515b(GL087PA)
Sawfish+Emacs+Firefox+Xpdf+MPlayer...
lb_bn
帖子: 1261
注册时间: 2007-02-25 16:56

#3

帖子 lb_bn » 2007-11-10 17:45

要加东东一般加到第一行后面(第二行),
加到最后,有时就是不行。。。
看不懂代码,只能这么说了。。。 :lol:
回复