loong qiang
像风一样自由

交互式shell

1.登录时作为默认登录shell 文本模式下输入用户名和密码的默认shell

读取bash主配置文件 /etc/profile

读取用户个性化设置 

$HOME/.bash_profile

$HOME/.bash_login

$HOME/.profile

不同系统选取的配置文件不一样,三个文件选一个进行配置

2.非登录交互shell 图像模式下 每次启动shell实例

不会读取 /etc/profile

读取 $HOME/.bashrc

非交互式shell

1.运行脚本的非交互式shell

启动时检查 BASH_ENV环境变量,一般都没有设置

 文件执行顺序

  /etc/profile -> (~/.bash_profile | ~/.bash_login | ~/.profile) -> ~/.bashrc -> /etc/bashrc -> ~/.bash_logout

 

 

posted on 2013-11-10 14:28  loong qiang  阅读(477)  评论(0编辑  收藏  举报