delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2005/08/25/06:08:18

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
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
Date: Thu, 25 Aug 2005 12:08:01 +0200
From: Corinna Vinschen <corinna-cygwin AT cygwin DOT com>
To: cygwin AT cygwin DOT com
Subject: Re: System environment variables
Message-ID: <20050825100801.GM17452@calimero.vinschen.de>
Reply-To: cygwin AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
References: <Pine DOT LNX DOT 4 DOT 62 DOT 0508241300580 DOT 26825 AT ns DOT pyerotechnics DOT com> <20050824174417 DOT GG17452 AT calimero DOT vinschen DOT de> <Pine DOT LNX DOT 4 DOT 62 DOT 0508241420530 DOT 26825 AT ns DOT pyerotechnics DOT com>
Mime-Version: 1.0
In-Reply-To: <Pine.LNX.4.62.0508241420530.26825@ns.pyerotechnics.com>
User-Agent: Mutt/1.4.2i

On Aug 24 14:27, Jason Pyeron wrote:
> On Wed, 24 Aug 2005, Corinna Vinschen wrote:
> 
> >On Aug 24 13:08, Jason Pyeron wrote:
> >>
> >>
> >>How can I get the ssh service to inherit the environment variables as set
> >>in the system properties control panel applet?
> >
> >You can't.  Use one of the methods to propagate environment variables
> 
> thats what I thought.
> 
> can I get some comments and critiques on my solution below:
> 
> 
> /etc/profile.d/winvars.sh
> 
> 
> #! /bin/sh
> 
> cd 
> /proc/registry/HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/Control/Session\ 
> Manager/Environment/
> 
> for i in * ; do
> 
>  bash -c "set -u ; echo \$$i" 2&> /dev/null || export $i="`cat $i`"
> 
> done

Basically a good idea, but it probably won't work for two reasons.

- Some of the env variables in the registry are REG_EXPAND_SZ strings which
  contain other variables like this:

     %SystemRoot%\System32

  These strings have to be expanded before they are usable as real env
  strings.

- The output of cat isn't quoted, so you will probably get wrong results
  when backslashes are used like above.


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader          mailto:cygwin AT cygwin DOT com
Red Hat, Inc.

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

- Raw text -


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