@
/etc/profile,/etc/profile.d/*.sh,~/.bashrc等,下面说明上述几个文件之间的关系和区别。
bash的运行模式可分为login shell和non-login shell。
/etc/profile。~/.bashrc。~/.bashrc(实际上是加载了~/.bashrc中的/etc/bashrc)或/etc/profile时,都会执行如下代码片段:
/etc/profile.d/*.sh文件,这样我们为什么不自定义一个my_env.sh文件用来存放java或者其他的环境变量,一劳永逸!Linux的环境变量配置在/etc/profile或/etc/profile.d/*.sh文件中的区别是什么?
原文:https://www.cnblogs.com/sunbr/p/14328157.html