On Fri, May 21, 2010 at 12:41 PM, sc <[email protected]> wrote:
> On Friday 21 May 2010 10:30:18 am James Vega wrote:
>
>> That's a workaround, not a fix.  Any program which is run via
>>  sudo, without passing the -i flag, is going to have $HOME set
>>  to the calling user's homedir instead of that of the user
>>  they're sudoing to.  The proper fix is to educate users to
>>  understand this since it affects more than just Vim.
>
> i took that to mean that i can have
>
>    cd ~/.build/hgvim/vim
>
> as the first line of my install script and i could run it with
> sudo
>
> for me, however, i get an error that there is no
> /root/.build/hgvim/vim and it can't find my script

You're not using the $HOME environment variable.  You're using ~, which
your shell interprets based on the effective user that it is running as,
similar to what the OP suggested.

I was specifically talking about the case of relying on the $HOME
environment variable, which is what Vim uses to decide where to place
the viminfo file.

-- 
James
GPG Key: 1024D/61326D40 2003-09-02 James Vega <[email protected]>

-- 
You received this message from the "vim_dev" 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

Raspunde prin e-mail lui