You are not logged in.
After migrating my Arch from an older laptop to a newer one, I noticed that I could not get my "su -" root-terminal to automatically take on Bash coloring. After digging around, I found out that this is because the /root/.bash_profile file is missing for root. According to https://wiki.archlinux.org/index.php/Bash, in the "But, in Arch, by default:" section, it says:
"which means that /etc/bash.bashrc and ~/.bashrc will be executed for all interactive shells, whether they are login shells or not."
But, of course, for the root user, this is only true if you have copied /etc/skel/.bash_profile to /root/.bash_profile.
To save other, possibly new, Archers the search, should we add this step to either pacstrap (assuming that this is what creates the initial /root folder), or at least add an instruction to copy it from /etc/skel to the installation instructions?
Offline
It should read /etc/profile in that case which by default sources /etc/bash.bashrc. At least, according to bash's man page. That is, it should work even if those files are not in /root.
CLI Paste | How To Ask Questions
Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L
Offline
It should read /etc/profile in that case which by default sources /etc/bash.bashrc. At least, according to bash's man page. That is, it should work even if those files are not in /root.
Not sure what you mean by "it", but what I found is that the Wiki is, in fact, correct, it says:
* if interactive + login shell → /etc/profile then the first readable of ~/.bash_profile, ~/.bash_login, and ~/.profile
...But, in Arch, by default:
* /etc/profile (indirectly) sources /etc/bash.bashrc
* /etc/skel/.bash_profile which users are encouraged to copy to ~/.bash_profile, sources ~/.bashrc
Now, /etc/bash.bashrc does NOT source ~/.bashrc, but it does source ~/.bash_profile, so the only way to pull in ~/.bashrc is to have an copy of /etc/skel/bash_profile as ~/.bash_profile, which sources ~/.bashrc.
I noticed that this is only an issue for /root. Any regular user will get the ~/.bash_profile copied from /etc/skel.
Offline