[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: bash not reading ~/.bashrc



Roberto Sanchez wrote:

> Why is it that when I switch to a text console with <Ctl>-<Alt>-<F1> that 
> bash does not read in my ~/.bashrc?
> 
> When I pull up a terminal in X it works fine (all my command aliases are 
> there).  And when I log in to a text console, if explicitly type in the 
> command 'bash' at the bash prompt, the new shell reads it in.  But the top 
> level shell from text login does not read it.
> 
> Any ideas?

Depends exactly what you mean.

Switching to a text console, by itself, does not cause bash to start
running, so there's no reason it should read .bashrc then.

If what you really mean is that .bashrc is not read when you login on a
text console, then that's covered by bash's man page, which you really
ought to read. .bash_profile or .profile is read by login shells;
.bashrc is read only by non-login shells. If you want .bashrc to be read
by all shells, then you need to put ". ~./bashrc" in your .bash_profile
or .profile to make it happen.

Craig

Attachment: pgpniTj6aegLN.pgp
Description: PGP signature


Reply to: