[Top][All Lists]

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

Re: lynx-dev bash remembers binary location (was

From: T.E.Dickey
Subject: Re: lynx-dev bash remembers binary location (was
Date: Thu, 4 Jun 1998 15:37:44 -0400 (EDT)

> > # Is it possible that linux caches binaries and allows you to 
> > # run the cached copy 
> >  
> > You're not running any kind of caching filesystems, are you? 
> > If not, then I'd say that Linux isn't.  Is the path to the 
> > new program the same as the old one? 
> The old lynx: /usr/bin/lynx 
> The new Lynx: /usr/local/bin/lynx 
> Bash was caching the last *location* it saw the binary.  (not the  
> image of the binary) 
Like 'rehash', Bash has:
bash$ help hash
hash: hash [-r] [name ...]
    For each NAME, the full pathname of the command is determined and
    remembered.  The -r option causes the shell to forget all remembered
    locations.  If no arguments are given, information about remembered
    commands is presented.

> "which" traverses the $PATH and finds the first match every time 
> it's invoked.  bash remembers the last place it found the file. 
> In fact :) when I mv /usr/bin/lynx /usr/bin/lynx.2.5 and then try to  
> invoke lynx from a "stale shell", I get:  
>       bash: /usr/bin/lynx: No sush file or directory 
> And the "which" command still picks up on the /usr/local/bin/lynx. 
> This may or may not be of any interest, but if the question was worth 
> asking in the first place, and I find the anwer..  then I should probably 
> post it. 
> Dennis 

Thomas E. Dickey

reply via email to

[Prev in Thread] Current Thread [Next in Thread]