Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

vim path directory

Status
Not open for further replies.

hok1man

Technical User
Feb 16, 2008
102
0
0
Hi guys,

I got vim in directory /apps/solaris/bin and in that directory got vi symbolic link to vim

odyssey 3 Sep 16 01:06 vi -> vim

but if I type which vim,
/apps/solaris/bin/vim

which vi,
/usr/bin/vi

I would like to redirect vi to vim, but how come doesn't work?

but if I do /apps/solaris/bin/vi, it's working and going to vim

the $PATH directory is /apps/solaris/bin first then /usr/bin



 
Sometimes the paths to utilities are tracked by the shell so that it doesn't have to search the PATH every time. Try launching a fresh shell and see if which recognises the new location of vi.

Annihilannic.
 
I have, but the result is still the same... which vi, they go to /usr/bin
 
You could try creating an alias for it...
Code:
alias    vi=/apps/solaris/bin/vim
The alias should be used before the shell goes searching the PATH for it.


 
Can you show us the output of echo $PATH for a sanity check too?

Annihilannic.
 
/usr/bin appears first before /apps/solaris/bin in your path. You could prepend /apps/solaris/bin/ to your path if there is little in there but the best bet is to use an alias.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top