bug-bash
[Top][All Lists]
Advanced

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

Re: .bashrc is sourced even for non-interactive shells (when run from ss


From: Pierre Gaston
Subject: Re: .bashrc is sourced even for non-interactive shells (when run from sshd)
Date: Sat, 2 Jun 2012 20:29:19 +0300

On Sat, Jun 2, 2012 at 8:24 PM, Mikel Ward <address@hidden> wrote:
> On Sat, Jun 2, 2012 at 10:19 AM, Pierre Gaston <address@hidden> wrote:
>> On Sat, Jun 2, 2012 at 8:15 PM, Mikel Ward <address@hidden> wrote:
>>> bash sources .bashrc even for some non-interactive shells.
> ...
>> "Remote non login non interactive shells"
>> Bash has a special compile time option that will cause it to source
>> the .bashrc file on non-login, non-interactive ssh sessions.
>
> IIUC, it was once a compile time option, but it's now hard-coded.  The
> isnetconn test doesn't seem to be toggled by any macro.
>
>      if ((run_by_ssh || isnetconn (fileno (stdin))) && shell_level < 2)
but  run_by_ssh is:

#ifdef SSH_SOURCE_BASHRC
      run_by_ssh = (find_variable ("SSH_CLIENT") != (SHELL_VAR *)0) ||
                   (find_variable ("SSH2_CLIENT") != (SHELL_VAR *)0);
#else
      run_by_ssh = 0;
#endif



reply via email to

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