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

"Caché" de bash



         Buenas.

         Este mensaje hace un rato era una pregunta, pero ya encontré la
     solución :^).  Lo mando de  todas formas porque  es algo que  no he
     visto en ningún sitio por ahora.

         Resulta que bajé el xchat-1.2.1 que vi anunciado en Freshmeat y
     tras instalarlo (sin  borrar el 1.1.7 de potato) lo  probé. Como se
     quedaba medio colgadín al resolver la  IP del servidor IRC, le hice
     un make uninstall y listo. El  caso es que bash seguía creyendo que
     xchat estaba en /usr/local/bin:

$ type -a xchat
xchat is /usr/bin/xchat
$ xchat
bash: /usr/local/bin/xchat: No existe el fichero o el directorio

         En la página  man de bash viene esto  claramente documentado en
     la sección COMMAND EXECUTION:

--
               Bash  uses  a hash table to remember the full file
       names of executable files (see hash  under  SHELL  BUILTIN
       COMMANDS below).  A full search of the directories in PATH
       is performed only if the command is not found in the  hash
       table.
--

         Luego, tras informarse de hash, uno ya se aclara:

$ hash
hits    command
[...]
   5    /usr/local/bin/xchat
[...]
$ hash xchat
$ hash
hits    command
[...]
   0    /usr/bin/xchat
[...]
$ xchat &
$

         Arreglado!  :^)


-- 
 Just do it.

David Serrano <ctv.es@fserrano>  http://www.ctv.es/USERS/fserrano
In love with TuX - Linux 2.2.12    Linux Registered User #87069


Reply to: