美文网首页
环境变量顺序

环境变量顺序

作者: 空气KQ | 来源:发表于2019-04-23 21:05 被阅读0次

加载顺序

/etc/profile -> ~/.bash_profile -> base ~/.bashrc -> /etc/bashrc -> /etc/profile.d/sh -> /etc/sysconfig/il8n
当用户登录进来,先加载/etc/profile ,加载完执行/etc/profile.d/
.sh脚本,然后才运行 HOME/.bash_profile(每个用户的环境变量) ,HOME/.bashrc,最后查找 /etc/bashrc
所有的脚本发现了就执行,没发现不执行

注意
如果希望在非登录Shell下读到环境变量,,就需要设置变量,写入到HOME/.bashrc或/etc/bashrc 而不是设置在HOME/.bash_profile 或/etc/profile

相关文章

网友评论

      本文标题:环境变量顺序

      本文链接:https://www.haomeiwen.com/subject/dlobgqtx.html