|
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.
...
When an interactive shell that is not a login shell is started, bash reads and executes commands from ~/.bashrc, if that file exists
昨天我做了一件事情
[root@sarge ~]PATH=aaa
[root@sarge ~] env
-bash: env: command not found
这样以来,大部分命令都需要输入绝对路径。我exit退出后重新登陆了一遍,PATH就恢复原来的了。
我的问题是:
PATH是在/etc/profile中设定的,我改掉后为何重新登陆就恢复了?我的理解是应该是系统重新启动后才应该恢复。
环境debian3.1r0 init 2 |
|