[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Help-bash] [newbie] non-interactive non-login bash shell
From: |
Divya Thaluru |
Subject: |
Re: [Help-bash] [newbie] non-interactive non-login bash shell |
Date: |
Thu, 10 Mar 2016 00:15:52 -0800 |
Thanks Pierre!! I will give it a try.
On Thu, Mar 10, 2016 at 12:14 AM, Pierre Gaston <address@hidden>
wrote:
>
>
> On Thu, Mar 10, 2016 at 9:36 AM, Divya Thaluru <address@hidden> wrote:
>
>> Hi Pierre,
>>
>> I was not able to find special compile time option. what is this option?
>>
>> From the url,
>> Bash has a special compile time option that will cause it to source the
>> .bashrc file on non-login, non-interactive ssh sessions. This feature is
>> only enabled by certain OS vendors (mostly Linux distributions). It is not
>> enabled in a default upstream Bash build, and (empirically) not on OpenBSD
>> either.
>>
>> I was not able to find special compile time option. what is this option?
>>
>> Thanks,
>> Divya
>>
>>
>> On Wed, Mar 9, 2016 at 11:30 PM, Pierre Gaston <address@hidden>
>> wrote:
>>
>>>
>>>
>>> On Thu, Mar 10, 2016 at 9:12 AM, Divya Thaluru <address@hidden>
>>> wrote:
>>>
>>>> Hi,
>>>>
>>>> I want to source /etc/profile automatically if I execute a command
>>>> through
>>>> ssh, which is non-interactive and non login shell. Is there a way to
>>>> achieve this? I really appreciate your help.
>>>>
>>>> ssh address@hidden 'echo "import os; print os.environ;" | python'
>>>>
>>>>
>>>> Thanks,
>>>>
>>>> Divya
>>>>
>>>
>>> Depending on your system, .bashrc might be sourced see:
>>> http://mywiki.wooledge.org/DotFiles
>>>
>>>
>>>
>> in config-top.h there is:
>
> /* Define this if you want bash to try to check whether it's being run by
> sshd and source the .bashrc if so (like the rshd behavior). This checks
> for the presence of SSH_CLIENT or SSH2_CLIENT in the initial
> environment,
> which can be fooled under certain not-uncommon circumstances. */
> /* #define SSH_SOURCE_BASHRC */
>
>
>
Re: [Help-bash] [newbie] non-interactive non-login bash shell, Bob Proulx, 2016/03/10