Monday, October 19, 2015

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

>-----Original Message-----
>From: vim_use@googlegroups.com [mailto:vim_use@googlegroups.com] On
>Behalf Of Random832
>Sent: Monday, October 19, 2015 9:14 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:
>
>> I thought this was pretty clear :-): And here are the steps again:
>>
>> 1) xterm with a login tcsh shell is created. At this time $c is set to
>> /volume/current.
>> 2) do " setenv c /volumeNew/current". As this time "echo $c" in this
>> shell shows new value;
>> 3) under vim, ":echo $c" shows new value;
>
>Please provide _all_ the steps. According to these steps you haven't even started
>vim. And are you doing the setenv to volumeNew within your original shell
>(before starting vim?) or in a :! or system() call?
>
>Also, how is the old value set in the first place? Is it in your cshrc?

[KCC] These are all the steps. First start the xterm and the tcsh, which as you said has $c set to old value in .cshrc. Then under the tcsh setenv $c to the new value. Then start vim and in vim do ":echo $c" which shows new value; and do ":let x = system("echo $c")", and then ":echo x" shows old value.

>> 4) under vim, ":let x = system("echo $c")", and then ":echo $c" shows
>> old value.
>
>Are you sure this is :echo $c or is it :echo x?
[KCC] My bad. It is ":echo x", which shows old value.
--Karl

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

Post a Comment