help-bash
[Top][All Lists]
Advanced

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

Re: question about .bash_profile


From: alex xmb sw ratchev
Subject: Re: question about .bash_profile
Date: Thu, 1 Feb 2024 12:43:51 +0100

i see .. thank you for your kind answers ...

On Thu, Feb 1, 2024, 12:40 Kerin Millar <kfm@plushkava.net> 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.
>
> One potential benefit of using ~/.profile is that it will also be read by
> other POSIX sh implementations, such as dash. Therefore, it should only
> contain code that is compatible with sh. I tend to define environment
> variables in ~/.profile before having it source ~/.bashrc, if appropriate.
>
> if [ "$BASH" ] && [ -f ~/.bashrc ]; then
>         . ~/.bashrc
> fi
>
> --
> Kerin Millar
>
>


reply via email to

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