[CLUE-Tech] Why can't bash find vi?

Timothy C. Klein teece at silverklein.net
Fri Oct 12 15:31:18 MDT 2001


Jed,
So this xterm was open before you changed any of this stuf with vi?  And
subsequent xterms work fine?  If that is the case, I would say that bash
is remembering where vi used to be.   Bash hashes previous directory
lookups in an internal data structure so that it does not have to look
up the location of the exec every time.  Try typing:
 
type vi

It should tell you where bash thinks it is.  If it says something like
(/bin/vi: hashed) that means it is stored in the internal data
structure, and will not be looked up again.  I don't remember if one
can clear that entry from the internal hash, but I would imagine one
could.


Tim

* Jed S. Baer (thag at frii.com) wrote:
> Greetings, fellow cluebies. I'm feeling clueless here ;-)
> 
> After deciding to abandon vim, and try out elvis, I installed elvis from
> RPM, and removed all vim RPMs. Noticing that I no longer had any "vi"
> executable on the system, I cd'd to /usr/local/bin and executed:
> 
>   ln -s `which elvis` vi
> 
> resulting in:
> 
>   $ ls -o /usr/local/bin/vi
>   lrwxrwxrwx    1 root           14 Oct 12 12:35 /usr/local/bin/vi ->
> /usr/bin/elvis
> 
> However, an xterm which was openned before I did all this has this
> problem:
> 
>   $ which vi
>   /usr/local/bin/vi
>   $ vi
>   bash: /bin/vi: No such file or directory
>   $ alias | grep -i vi (no matches)
>   $ env | grep -i vi (no matches)
> 
> new xterms don't have this trouble.
> 
> So, after rummaging through various man pages, config files, etc., without
> finding an answer, I'm wondering what "helpful" feature of bash is
> resulting in it not just running the executable on the path.
> 
> TIA
> jed
> -- 
> "Some people spend an entire lifetime wondering if they've made a
>  difference. Free Software developers don't have that problem."
> _______________________________________________
> CLUE-Tech mailing list
> CLUE-Tech at clue.denver.co.us
> http://clue.denver.co.us/mailman/listinfo/clue-tech
--
==============================================
== Timothy Klein || teece at silverklein.net   ==
== ---------------------------------------- ==
== "Hello, World" 17 Errors, 31 Warnings... ==
==============================================



More information about the clue-tech mailing list