[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Symlink clarification needed (vi -> vim)



On Sat, Sep 28, 2002 at 03:56:51PM +0200, Robert Ian Smit wrote:
> I know that some programs react differently depending on how they
> are called. When you create a symlink to a program, does the program
> know that it was started by using a symlink?
> 
> For instance when I create a vi symlink to vim, will vim start up
> normally or will it mimick vi?
> 

The program could find this out by checking
the command line arguments. It might happen that 
the program would create symlinks and operate 
in this way.

Actually vim does do this but it doesn't check
for vi. It checks for the following (according
to man vim) vim, ex, view, gvim/gview, 
rvim/rview/rgvim/rgview. These might all refer
to the same executable but would run it in
different ways.

Since vim doesn't check if you have typed vi
it should run fine. I am almost certain of this
as my web host has actually renamed vim to vi
and it runs just like vim.

If you want to be absolutely sure you can either:
a) find where vim is located and run it explicitly
/usr/bin/vim
b) create your own symlink to vim, and have the
symlink be called vim
c) create an alias to vim,
...

However I am not familiar with debian policy.
It might be that with alternatives the policy
is to have them all behave the same way. Again
I really doubt that would be the case as it would
tend to confuse users.

Hope that helps

Bijan



Reply to: