登录shell和非登录shell的区别
先上图:
这两种shell的主要区别在于,他们启动时会加载不同的配置文件,login shell 启动时会加载/etc/profile,
~/.bashrc,
~/.bashrc.
而non-login shell 启动会加载~/.bashrc.
而在加载~/.bashrc (实际是~/bashrc中加载的/etc/profile)或/etc/profile时,都会执行以下代码片段:
因此不管是login shell 还是non-login shell 启动时都会加载/etc/profile.d/*.sh 中的环境变量