You are not logged in.
Hi all
Finally got around to getting my home LAPP server up and running - on Arch of course!
Small problem that's really annoying. I can't get root's shell to source the .bashrc file.
I (kind of) followed the colorized prompt tip from the Wiki:
http://wiki.archlinux.org/index.php/Pos … nd_Console
Except I put EVERYTHING in to /etc/bashrc then sym linked my user and root ~/.bashrc to /etc/bashrc:
fukawi2 ~ $ ls -lha .bashrc
lrwxrwxrwx 1 fukawi2 fukawi2 11 2008-04-01 21:53 .bashrc -> /etc/bashrc
And that works fine. Root doesn't though. I tried removing the symlink and replacing it with a 'normal' .bashrc file that only sources /etc/bashrc if it exists:
[root@lapp ~]# cat .bashrc
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi
But if I source it manually after I su or sudo, it works fine:
fukawi2 ~ $ sudo -i
[root@lapp ~]#
[root@lapp ~]# (There's no pretty colorized prompt here)
[root@lapp ~]#
[root@lapp ~]# logout
fukawi2 ~ $ su -
Password:
[root@lapp ~]#
[root@lapp ~]# (Still no pretty prompt!)
[root@lapp ~]#
[root@lapp ~]# logout
fukawi2 ~ $ sudo -i
[root@lapp ~]# . .bashrc
root ~ #
root ~ # (That's better; now I have the pretty prompt!)
root ~ #
Not having the colors doesn't bother me so much - it's not having all my aliases and not being able to change root's $PATH variable to include /usr/local/bin/ that's really annoying.
Anyone got any advice or suggestions please?
Are you familiar with our Forum Rules, and How To Ask Questions The Smart Way?
BlueHackers // fscanary // resticctl
Offline
See thread.
Offline
Besides having a .bashrc file, you also need a .bash_profile file in root's home directory. .bash_profile should contain the following:
. $HOME/.bashrc
the .bash_profile file tells bash what file to use for configuration, which by convention has always been .bashrc.
HTH
Pudge
Edit: Opps, too slow on the trigger. Brebs beat me to it. I spent too much time looking in man bash for an explanation of the .bash_profile and .bashrc files.
Last edited by Pudge (2008-04-03 02:04:54)
Offline
Thanks guys, works beautifully now
I did Google before asking but couldn't find anything - I should use the forum search too, sorry!
So bash actually sources .bash_profile and it's up to that file to source .bashrc for interactive shells?
Are you familiar with our Forum Rules, and How To Ask Questions The Smart Way?
BlueHackers // fscanary // resticctl
Offline