On 2019-11-26 23:19 +0800, Xi Ruoyao wrote: > On 2019-11-26 07:44 -0700, Flareon Zulu wrote: > > Correct me if I'm wrong: doesn't the system bashrc always load > > before > > the user's home bashrc loads? And > > from just what I remember, the lfs bashrc re-initializes the > > environment anyway. So, why move from Arch just > > because of load order on bashrc?
In LFS Chap 5 "su - lfs" starts a login shell. It loads "/home/lfs/.bash_profile". It contains a line "exec env -i ... /bin/bash" to start a bash w/o environments (except $HOME, $TERM, and $PS1 set in the command line). The new shell started is an interactive, non-login shell which is supposed to load ".bashrc" and then set other environments. But on Arch (and some other distributions) non-login bash loads /etc/bash.bashrc before .bashrc. The environments in bash.bashrc may pollutes the LFS building environment. For example, on Arch, our $PS1 (set in .bash_profile, should be '\u:\w\$ ') would be overwritten (become `[\u@\h \W]\$ '). > /etc/bashrc won't be loaded automatically. It is loaded by > ~/.bashrc, > with something like > if [ -f /etc/bashrc ]; then > > source /etc/bashrc > > fi > > > > (see section "The Bash Shell Startup Files" in BLFS book.) > > > > But in Arch, bash was built with an option telling bash to load > > /etc/bash.bashrc automatically before ~/.bashrc. -- Xi Ruoyao <[email protected]> School of Aerospace Science and Technology, Xidian University -- http://lists.linuxfromscratch.org/listinfo/lfs-support FAQ: http://www.linuxfromscratch.org/blfs/faq.html Unsubscribe: See the above information page Do not top post on this list. A: Because it messes up the order in which people normally read text. Q: Why is top-posting such a bad thing? A: Top-posting. Q: What is the most annoying thing in e-mail? http://en.wikipedia.org/wiki/Posting_style
