linux下.bash_*文件的执行顺序
2013-10-10 15:30
218 查看
摘自:Linux 101 Hacks: 84
下列文件的执行顺序是什么?
交互式登录 shell 的执行顺序
下面的伪代码将说明这些文件的执行顺序
当你从交互式 shell 中注销,以下是执行顺序:
请注意 /etc/bashrc 是通过~/.bashrc 执行,如下所示:
非登录交互式 shell 的 执行顺序
当你启动一个非登录交互式 shell,下面是执行顺序
[注意:当一个非交互式 shell 启动,它会寻找环境变量 ENV,并执行环境变量 ENV 里的文件名变量。]
下列文件的执行顺序是什么?
/etc/profile ~/.bash_profile ~/.bashrc ~/.bash_login ~/.profile ~/.bash_logout
交互式登录 shell 的执行顺序
下面的伪代码将说明这些文件的执行顺序
execute /etc/profile IF ~/.bash_profile exists THEN execute ~/.bash_profile ELSE IF ~/.bash_login exist THEN execute ~/.bash_login ELSE IF ~/.profile exist THEN execute ~/.profile END IF END IF END IF
当你从交互式 shell 中注销,以下是执行顺序:
IF ~/.bash_logout exists THEN execute ~/.bash_logout END IF
请注意 /etc/bashrc 是通过~/.bashrc 执行,如下所示:
# cat ~/.bashrc if [ -f /etc/bashrc ]; then . /etc/bashrc Fi
非登录交互式 shell 的 执行顺序
当你启动一个非登录交互式 shell,下面是执行顺序
IF ~/.bashrc exists THEN execute ~/.bashrc END IF
[注意:当一个非交互式 shell 启动,它会寻找环境变量 ENV,并执行环境变量 ENV 里的文件名变量。]
相关文章推荐
- linux下系统启动时,几个配置文件 /etc/profile、~/.bash_profile 等几个文件的执行过程,先后顺序
- linux下系统启动时,几个配置文件 /etc/profile、~/.bash_profile 等几个文件的执行过程,先后顺序
- linux下系统启动时,几个配置文件 /etc/profile、~/.bash_profile 等几个文件的执行过程,先后顺序
- [转] Linux 之 /etc/profile、~/.bash_profile 等几个文件的执行过程
- Linux中profile、bashrc、~/.bash_profile、~/.bashrc、~/.bash_profile之间的区别和联系以及执行顺序
- [zz]登录Linux时/etc/profile、~/.bash_profile等几个文件的执行过程
- Linux下bash配置及执行顺序
- 理解Linux环境变量及配置文件执行顺序 博客分类: Linux 每个用户都有自己专属的运行环境,这个环境是由一组变量所定义,这些变量称之为环境变量。用户可以修改环境变量以满足自己的要求。
- 理解Linux环境变量及配置文件执行顺序
- 理解Linux环境变量及配置文件执行顺序
- bash中profile等配置文件执行顺序
- Linux 之 /etc/profile、~/.bash_profile 等几个文件的执行过程
- Linux 之 /etc/profile、~/.bash_profile 等几个文件的执行过程
- CentOS6 /etc/profile ~/.bash_profile ~/.bashrc等文件的执行顺序
- 【转】Linux 之 /etc/profile、~/.bash_profile 等几个文件的执行过程
- [转]linux中,/etc/profile、~/.bash_profile等几个文件的执行过程
- Linux学习日记 —— 10.3.4 Shell基础-Bash基本功能-多命令顺序执行与管道符
- 关于登录linux时,/etc/profile、~/.bash_profile等几个文件的执行过程
- Linux 中/etc/profile、~/.bash_profile 等几个环境配置文件的执行过程
- 登录Linux时/etc/profile、~/.bash_profile等几个文件的执行过程