Wayne Sallee wrote:


On 09/27/2015 01:18 PM, Bruce Dubbs wrote:

|if [ -f "$HOME/.bashrc" ] ; then
   source $HOME/.bashrc
fi|

it's ok for one to refer to the other, but creates an error when both
refer to each other.

The construct above is in  ~/.bash_profile which is only called during
an initial login.  It calls $HOME/.bashrc which in turn may call
/etc/bashrc.  /etc/bashrc does not call any other script.

Maybe the mistake is that that same command is in the .bashrc pointing
back to itself.

Perhaps, but where did it come from?  Not the book.

But I am also using package users method, so I might have picked
something up with that, though my memory is that the error was in the
lfs or blfs book.

The lfs book does not mention .bashrc contents except for the lfs user.
The essential commands in the blfs book has been there since 2002.

I now have "source /root/.bash_profile" in .bashrc.

That would be considered wrong by most users. You use the bash_profile to mostly set environment variables that would be inherited by subshells. bashrc defines things like aliases and PS1 that are not inherited by subshells.

The unique issue was that I only got the error when I typed a correct
password for root, but would not error if I crooted into root. And I
think it would not error if I started it up and signed in as root, but
su from root to root would give the error.

chroot would not execute .bash_profile unless you used the command '/bin/bash --login' in the chroot command.

  -- Bruce

--
http://lists.linuxfromscratch.org/listinfo/blfs-support
FAQ: http://www.linuxfromscratch.org/blfs/faq.html
Unsubscribe: See the above information page

Reply via email to