This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Re: tclsh does not export changes to env to child process
- From: Stas Maximov <stas dot maximov at gmail dot com>
- To: cygwin at cygwin dot com
- Date: Tue, 30 Jun 2015 09:43:27 -0700
- Subject: Re: tclsh does not export changes to env to child process
- Authentication-results: sourceware.org; auth=none
- References: <CAO-z7kzjRBrADMYd1h79=VTdY8ME9jLKrFgg+-SFZvRDWduScw at mail dot gmail dot com> <CAO-z7ky+2C37Y_kEjbwVoXEfcb_xwNeOBCex3wTKfBVHisuLBw at mail dot gmail dot com>
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
On Tue, Jun 30, 2015 at 9:39 AM, Stas Maximov <stas.maximov@gmail.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 Mon, Jun 29, 2015 at 2:45 PM, Stas Maximov <stas.maximov@gmail.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.
--
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