- 论坛徽章:
- 0
|
原帖由 a-ki 于 2006-9-16 21:19 发表
新安装的debian系统,发现在~/.bash_profile文件就是不执行。
查了以前的贴子,和 man,其中在man bash的手册中写到:
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.
对系统进行了检查,发现在首先/etc/profile文件是存在的,并且在其中对变量设置也是可以的;然后~/.bash_profile文件也是存在的,并且对它的权限为644,但是在其中加入设置就是不行,怀疑其在系统启动的时候没有执行。
但是,发现在一个怪现象,就是如果按ctrl+alt+f1打开一个新的终端,发现在~/.bash_profile是可以执行的,因为我在其中加入了一条 echo。
到底为啥,有人遇到过吗?
你的问题好像有点矛盾。
放在 ~/.bash_profile 当然是你输入帐号密码后启动该 shell 这类 "login shell mode" 时才会读取的。所以你说按下 ctrl-alt-f1 于 console 登入,这是属于 login shell mode,这时候 ~/.bash_profile 会读取。
若是你说的是 X 下开终端机要跑的叙述,那你应该是放在 ~/.bashrc 才对。
== |
|