加载顺序
/etc/profile -> ~/.bash_profile -> base ~/.bashrc -> /etc/bashrc -> /etc/profile.d/sh -> /etc/sysconfig/il8n
当用户登录进来,先加载/etc/profile ,加载完执行/etc/profile.d/.sh脚本,然后才运行 HOME/.bashrc,最后查找 /etc/bashrc
所有的脚本发现了就执行,没发现不执行
注意
如果希望在非登录Shell下读到环境变量,,就需要设置变量,写入到HOME/.bash_profile 或/etc/profile
网友评论