bug-bash
[Top][All Lists]
Advanced

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

Re: ~/.profile and ~/.bash_profile aren't executed on login


From: Pierre Gaston
Subject: Re: ~/.profile and ~/.bash_profile aren't executed on login
Date: Sun, 10 Dec 2017 08:31:58 +0200

On Sun, Dec 10, 2017 at 1:41 AM, Yuri <address@hidden> wrote:

> On 12/09/17 15:24, Chet Ramey wrote:
>
>> Of course not: that's not a login shell.  As the documentation says,
>>
>> "A login shell is one whose first character of argument zero is a -,  or
>> one started with the --login option."
>>
>> The INVOCATION section of the manual page explains it in exhaustive
>> detail.
>>
>
>
> Ok, but that's not what my situation is. I am just logging in, using the
> display manager, when user has /usr/local/bin/bash as the shell in passwd.
>
> Why doesn't it execute ~/.profile?
>
>
> Yuri
>
>
>
.profile is supposed to be a file that is read only once per
login, so that you can do initialization there.  When you run the
shell after login it doesn't read this file anymore (there are
other initialization files eg .bashrc that are read every time)

There is a couple of tricks coming from the history of Unix to
tell a shell that it should do this initialization and these
tricks are used by the programs handling the login when they
start a shell.

However, the way you log in to your system seems to not involve
bash (or even a shell), then when you start a terminal, bash is
invoked as a non-login interactive shell.

You can read more there:
http://mywiki.wooledge.org/DotFiles


reply via email to

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