X-Recipient: archive-cygwin@delorie.com
X-SWARE-Spam-Status: No, hits=-3.1 required=5.0	tests=AWL,BAYES_00,KHOP_THREADED,RP_MATCHES_RCVD
X-Spam-Check-By: sourceware.org
Message-ID: <50A13A32.9050805@cs.umass.edu>
Date: Mon, 12 Nov 2012 13:04:34 -0500
From: Eliot Moss <moss@cs.umass.edu>
Reply-To: moss@cs.umass.edu
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:16.0) Gecko/20121026 Thunderbird/16.0.2
MIME-Version: 1.0
To: cygwin@cygwin.com
Subject: Re: environment variables in ssh non-interactive shell
References: <CALvQJKtk12V1E1s68_4WvmAaswPk+=iaB=h3+Yupfz=TKAb9Fg@mail.gmail.com>
In-Reply-To: <CALvQJKtk12V1E1s68_4WvmAaswPk+=iaB=h3+Yupfz=TKAb9Fg@mail.gmail.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-IsSubscribed: yes
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com

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

