delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2012/11/13/15:26:14

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=-4.6 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,KHOP_RCVD_TRUST,KHOP_THREADED,RCVD_IN_DNSWL_LOW,RCVD_IN_HOSTKARMA_YE
X-Spam-Check-By: sourceware.org
MIME-Version: 1.0
In-Reply-To: <50A13A32.9050805@cs.umass.edu>
References: <CALvQJKtk12V1E1s68_4WvmAaswPk+=iaB=h3+Yupfz=TKAb9Fg AT mail DOT gmail DOT com> <50A13A32 DOT 9050805 AT cs DOT umass DOT edu>
From: Ariel Sommeria <ariel DOT publique AT gmail DOT com>
Date: Tue, 13 Nov 2012 21:25:39 +0100
Message-ID: <CALvQJKstnYnFfGPpQETtmM_Am+=jUQF9vkow0ifaoCW3hZPYzQ@mail.gmail.com>
Subject: Re: environment variables in ssh non-interactive shell
To: cygwin AT cygwin DOT com
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

in the doc on the environment file, it explicitly states that there
can only be key/value pairs, no commands.
I tried, and it generates an error.
But like I said I sort of got it to work, so thanks!

On Mon, Nov 12, 2012 at 7:04 PM, Eliot Moss <moss AT cs DOT umass DOT edu> wrote:
> On 11/12/2012 7:10 AM, Ariel Sommeria wrote:
>>
>> Hi,
>> I'm trying to use environment variables to pilot a windows system
>> through cygwin+ssh. Things work nicely with an interactive shell, but
>> mess up with a non-interactive shell because my environment variables
>> aren't set.
>> I've set PermitUserEnvironment to yes in my sshd_config, I've set
>> BLA=bla in .ssh/environment. Now when in my script I call 'env', I do
>> see BLA in it. However echo $BLA doesn't echo anything.
>> The only similar issue and suggestion I've found is this:
>> http://cygwin.com/ml/cygwin/2004-10/msg01028.html
>> Obviously I use the environment file, but it doesn't help.
>> Does anyone have an idea what could be wrong?
>
>
> I wonder whether you *exported* the variables in question.
>
> BLA=bla
>
> will put the setting in your environment, but does not automatically
> add it to the environment of things you invoke.  For that to happen,
> you need to say:
>
> export BLA=bla
>
> (or have 'set =a' active in bash).
>
> Regards -- Eliot Moss
>
>
> --
> Problem reports:       http://cygwin.com/problems.html
> FAQ:                   http://cygwin.com/faq/
> Documentation:         http://cygwin.com/docs.html
> Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
>

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019