Sunday, October 18, 2015

RE: system command takes a different environment variable from current shell?

Regarding " What is your _exact_ set of steps that results in echo $c showing /volumeNEW/current"

641% echo $c
/volume/current
642% setenv c /volumeNew/current
643% echo $c
/volumeNew/current

My vim is version 7.4. But is has same problem on 7.3.121 or 7.0.94. And I tried this on FreeBSD and Linux. Thanks.
--Karl

-----Original Message-----
From: vim_use@googlegroups.com [mailto:vim_use@googlegroups.com] On Behalf Of Random832
Sent: Sunday, October 18, 2015 8:30 AM
To: vim_use@googlegroups.com
Subject: Re: system command takes a different environment variable from current shell?

"Karl (Xiangrong) Cai" <xcai@juniper.net> writes:
> And in vim, when I do 1) echo $c, and 2) let x = system("echo $c");
> and then "echo x", both shows "/volume/current", which is expected;
> Then inside this shell I set this variable to another value:
> <<<
> 603% setenv c /volumeNEW/current
> 604% env | grep "SHELL\|current"
> SHELL=tcsh
> c=/volumeNEW/current
> XTERM_SHELL=/bin/tcsh
>>>>
> And now in in vim, when I do "echo $c" it shows the new value
> "/volumeNEW/current",

That is very surprising, if you're not leaving anything out.

How exactly did you set the variable? The only way to get back to the original shell without closing vim is to suspend vim (ctrl-z), but you didn't mention doing this. I suspended vim, did setenv, put vim back in foreground (fg), and echo $c showed the original value.

What is your _exact_ set of steps that results in echo $c showing /volumeNEW/current ?

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments: