Re: Strange .bashrc Problem
- Date: Wed, 25 Apr 2018 23:12:53 +0300
- From: Abdullah Ramazanoglu <ar018@xxxxxxxxx>
- Subject: Re: Strange .bashrc Problem
On Wed, 25 Apr 2018 16:02:12 -0400 Greg Wooledge said:
> On Wed, Apr 25, 2018 at 10:49:52PM +0300, Abdullah Ramazanoglu wrote:
> > It seems like when ~/.bash_profile did not exist, then ~/.bashrc is called
> > directly.
> That's not correct.
> As a LOGIN shell, bash reads ONE file, searching among the following items
> in sequence:
> a) ~/.bash_profile
> b) ~/.bash_login
> c) ~/.profile
> Whichever one it finds first, that's what it reads. If you also want it
> to read ~/.bashrc (you DO want this), then you must ensure that ~/.bashrc
> gets sourced/dotted from whatever file bash DOES read.
Thank you for the correction. I have just checked my home dir and indeed
~/.profile sources ~/.bashrc
Therefore, sourcing ~/.profile (instead of ~/.bashrc) at the end of
~/.bash_profile would be the correct move, as you have said.