delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2011/09/09/17:16:38

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=4.7 required=5.0 tests=AWL,BAYES_50,BOTNET,RCVD_IN_DNSWL_NONE
X-Spam-Check-By: sourceware.org
Message-id: <4E6A820A.5020904@cygwin.com>
Date: Fri, 09 Sep 2011 17:15:54 -0400
From: "Larry Hall (Cygwin)" <reply-to-list-only-lh AT cygwin DOT com>
Reply-to: cygwin AT cygwin DOT com
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:6.0) Gecko/20110812 Thunderbird/6.0
MIME-version: 1.0
To: cygwin AT cygwin DOT com
Subject: Re: setting environment for bash running via cygserver
References: <loom DOT 20110909T192501-772 AT post DOT gmane DOT org>
In-reply-to: <loom.20110909T192501-772@post.gmane.org>
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.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

On 9/9/2011 1:44 PM, Alan Sinclair wrote:
> Where can I set environment variables which will be available in a
> bash script running under cygserver?
>
> I need to ssh onto a remote cygserver and run bash scripts. RSA keys
> are all set up so no password is needed and I can ssh onto the target
> machine just fine by doing
>      ssh me AT machine bash ~/myscript.sh ARGS
>
> But myscript.sh is not getting the environment it needs. For example,
> the script needs PROGRAMFILES, and also needs PROCESSOR_ARCHITEW6432
> set in the environment on 64-bit OS.

Best to put them in a file you can source when you SSH into the other
machine.  For the case above, you could then source that in your script
or in some appropriate rc file if "SSH_CLIENT" is set in your environment.

-- 
Larry

_____________________________________________________________________

A: Yes.
 > Q: Are you sure?
 >> A: Because it reverses the logical flow of conversation.
 >>> Q: Why is top posting annoying in email?

--
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