登录和退出时shell的执行顺序

来源:互联网 发布:js数组的遍历 编辑:程序博客网 时间:2024/05/16 09:17

当你登录一个交互式的login shell时,各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时,shell文件的执行顺序如下:

IF ~/.bash_logout exists THEN     execute ~/.bash_logout END IF 


当你登录一个非交互式的non-login shell时,shell文件执行顺序如下:(伪代码表示)

IF ~/.bashrc exists THEN     execute ~/.bashrc END IF


0 0
原创粉丝点击