Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , 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 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: <20050824174417 DOT GG17452 AT calimero DOT vinschen DOT de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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/