You are not logged in.
Pages: 1
Moin
When I change to the root user the bashrc is not sourced. No matter if I "su -" or login as root, the /root/.bashrc is not source. I need to manually type "source ~./.bashrc".
On all other Linux-distros I ever used this was done automatically.
How can I change this behavious?
Thanks in advance.
Offline
I am not 100% sure, but I suppose that after "su -" is bash invogen in login mode. In that case it uses ~/.bash_profile - do you have this file in home and is line ". $HOME/.bashrc" inside ?
Offline
yes, "su -" invokes a login shell. source ~/.bashrc from ~/.bash_profile or ~/.profile, as stabele suggested. See man bash for the gory details about rcfile loading.
Offline
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
in your ~/.profile
Offline
It works, thank you very much.
Shouldn't this be the default behaviour?
Offline
no
edit: But it is customary to `. ~/.bashrc` in ~/.bash_profile
Last edited by Mr.Elendig (2009-04-27 13:35:23)
Evil #archlinux@libera.chat channel op and general support dude.
. files on github, Screenshots, Random pics and the rest
Offline
both .bashrc and .bash_profile are available from /etc/skel. Usually, the contents of this directory are copied to a new user's home directory when using the useradd command. I'm not sure why they're not added to the /root directory on a fresh install. The answer is probably on the arch-dev-public mailing list.
Offline
Pages: 1