help-bash
[Top][All Lists]
Advanced

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

Re: question about .bash_profile


From: Greg Wooledge
Subject: Re: question about .bash_profile
Date: Thu, 1 Feb 2024 07:21:50 -0500

On Thu, Feb 01, 2024 at 11:39:27AM +0000, Kerin Millar wrote:
> On Thu, 1 Feb 2024, at 11:09 AM, alex xmb sw ratchev wrote:
> > is it as equivalent as .profile ?
> 
> Please refer to INVOCATION in the manual. Bash looks for ~/.bash_profile, 
> ~/.bash_login and ~/.profile in that order, reading and executing commands 
> from the first of those three files that it finds. So, if you want for bash 
> to recognise ~/.profile, you have to ensure that ~/.bash_profile does not 
> exist.

Or source ~/.profile from ~/.bash_profile.  This is something that one
might do if one sometimes switches login shells, or shares this home
directory across multiple machines, some of which have different login
shells.

The idea, in this case, would be to put all of the shell-portable stuff
in ~/.profile, and to put each shell's specific stuff in its unique
startup file, which sources or dots in ~/.profile at some point.

Of course, there are lots of ways to set things up, so one should choose
whatever is most appropriate for one's needs.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]