delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2015/07/04/22:56:09

X-Recipient: archive-cygwin AT delorie DOT com
DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:date:from:to:subject:message-id:references
:mime-version:content-type:in-reply-to; q=dns; s=default; b=td0k
6BpCF7/KdkiVUu3d86CrwRKSw0oN+JdeXQkTII1SRKZWHprNf+HVBf0FAPWTiHyY
ybqUpjn9H0Rr86RPQE0pK/K7wlXGj3IjL+GY3454IZKqchRzQoO7gYKAJ9Gm1BNk
1ZtH3DJzg0Av4kxXRGdYY4LhK29fnxUS0hzBNlA=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:date:from:to:subject:message-id:references
:mime-version:content-type:in-reply-to; s=default; bh=Wq7bkTuJHU
7l2+HqNb/KaaNqmRg=; b=DqKXMtaxl29C6FUfi//2YAm3sLrc1fWHXEYgZgi77J
PG0zbfCfoRWja/qjt7Y/6yYST8Fr4hUevAeD95aeikpIjuwAn/LrwgNqVdEjR5Hc
6Af07Led9b2JSfH9QEDkkhQI5iVDSYnq4J1+wniVcRcDjsAiLVtz0SK17MryXYxk
8=
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
Authentication-Results: sourceware.org; auth=none
X-Virus-Found: No
X-Spam-SWARE-Status: No, score=2.9 required=5.0 tests=AWL,BAYES_50,KAM_LAZY_DOMAIN_SECURITY,KAM_TK,RCVD_IN_DNSWL_LOW autolearn=no version=3.3.2
X-HELO: mail108.syd.optusnet.com.au
Date: Sun, 5 Jul 2015 12:55:29 +1000
From: Duncan Roe <duncan_roe AT acslink DOT net DOT au>
To: cygwin AT cygwin DOT com
Subject: Re: tclsh does not export changes to env to child process
Message-ID: <20150705025529.GB3180@dimstar.local.net>
Mail-Followup-To: cygwin AT cygwin DOT com
References: <CAO-z7kzjRBrADMYd1h79=VTdY8ME9jLKrFgg+-SFZvRDWduScw AT mail DOT gmail DOT com> <CAO-z7ky+2C37Y_kEjbwVoXEfcb_xwNeOBCex3wTKfBVHisuLBw AT mail DOT gmail DOT com> <CAO-z7kwDFz-q4sbBy3iPrsBOfLh8uik7=5a3cm6J9ShFEtDvAA AT mail DOT gmail DOT com>
MIME-Version: 1.0
In-Reply-To: <CAO-z7kwDFz-q4sbBy3iPrsBOfLh8uik7=5a3cm6J9ShFEtDvAA@mail.gmail.com>
User-Agent: Mutt/1.5.22 (2013-10-16)
X-Optus-CM-Score: 0
X-Optus-CM-Analysis: v=2.1 cv=ItbjC+Lg c=1 sm=1 tr=0 a=+cDhJlqnNvz9E7c5l3ERGg==:117 a=+cDhJlqnNvz9E7c5l3ERGg==:17 a=y26AOypDAAAA:8 a=PO7r1zJSAAAA:8 a=iaFubHWvAAAA:8 a=BTUk5m_ZKwEA:10 a=kj9zAlcOel0A:10 a=zOBTXjUuO1YA:10 a=pGLkceISAAAA:8 a=7vUEEOO_AAAA:8 a=gmw8mGJ0aZv7W3fEUZUA:9 a=CjuIK1q_8ugA:10 a=-FEs8UIgK8oA:10 a=NWVoK91CQyQA:10
X-IsSubscribed: yes

> > On Mon, Jun 29, 2015 at 2:45 PM, Stas Maximov <stas DOT maximov AT gmail DOT com> wrote:
> > > Hi,
> > >
> > > Tcl shell does not export changes to array variable env:
> > >   http://wiki.tcl.tk/env
> > >
> > > Test script: test_env_export1:
> > > --------- begin ----------
> > > set env(FILENAME) filename_val
> > > puts $env(PATH)
> > > puts [exec /bin/bash -c {echo $PATH}]
> > > puts $env(FILENAME)
> > > puts [exec /bin/bash -c {echo $FILENAME}]
> > > --------- end ----------
> > >
> > > Expect two lines of output "filename_val", receive only one. The bug
> > > affects 'guitool' feature of git-gui.
> > >
> > > cygwin 2.0.4-1
> > > tclsh 8.5
> > >
> > >
> > > Thanks,
> > > Stas.
> On Tue, Jun 30, 2015 at 9:39 AM, Stas Maximov <stas DOT maximov AT gmail DOT com> wrote:
> > Yakov,
> >
> > Thanks for the reply.
> >
> > Apologies for confusion. 8.5 was version of tcl as reported by
> > tcl_version. Please find below more information. Note that
> > "filename_val" is printed only once -- by tclsh, but the child (bash)
> > does not see environment variable FILENAME.
> >
> > Any specific information that you might want to see?
> >
> > Stas.
> >
> >
> > $ which tclsh
> > /usr/bin/tclsh
> >
> > $ cygcheck.exe -c tcl cygwin
> > Cygwin Package Information
> > Package              Version        Status
> > cygwin               2.0.4-1        OK
> > tcl                  8.5.18-1       OK
> >
> > $ cat test_env_export1.tcl
> > set env(FILENAME) filename_val
> > puts $env(FILENAME)
> > puts [exec /bin/bash -c {echo $FILENAME}]
> > puts $env(EDITOR)
> > puts [exec /bin/bash -c {echo $EDITOR}]
> >
> > $ tclsh test_env_export1.tcl
> > filename_val
> >
> > vim
> > vim
> >
> >
>
On Tue, Jun 30, 2015 at 09:43:27AM -0700, Stas Maximov wrote:
> Interestingly, if environment variable FILENAME was exported when
> tclsh called, the test passes. Tclsh falis to export only new env
> variable. Compare two results:
>
> $ env FILENAME=gaga tclsh test_env_export1.tcl
> filename_val
> filename_val
> vim
> vim
> $ env -u FILENAME tclsh test_env_export1.tcl
> filename_val
>
> vim
> vim
>
>
Years ago I seem to recall a problem with tclsh not exporting amended
environment variables. Looks like it's fixed now though, at least on my Linux
system (sorry it's tclsh 8.6)

> 12:37:18$ env|grep ZXC
> 12:37:31$ tclsh
> % set env(ZXC) hello
> hello
> % puts $env(ZXC)
> hello
> % puts [exec /bin/bash -c {echo $ZXC}]
> hello
> % info vars
> tcl_rcFileName tcl_version argv0 argv tcl_interactive auto_path auto_index env tcl_pkgPath tcl_patchLevel argc tcl_library tcl_platform
> % puts $tcl_patchLevel
> 8.6.1
> % exit

Cheers ... Duncan.

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