On 2021-08-31 at 10:58, Steve Dondley wrote: > OK, so I dropped the new fzf into /usr/local/bin. I confirmed it is the > correct version with: > > admin@ip-172-30-0-226 /usr/local/bin >> $ ./fzf --version > 0.27.2 (e086f0b) > > "echo $PATH" reports: > > /usr/local/bin:/usr/bin:/bin:/usr/games > > So it looks like any binary in /usr/local/bin should load first. > > However, "which fzf" reports the /usr/bin as the location: > > /usr/bin/fzf > > I'm using zsh. > > What am I missing?
This sounds like a stale-hash situation. According to my understanding, the shell will typically keep a cache of what path it found a given command at when it checked for that command in $PATH, so it doesn't have to re-do the filesystem accesses on every run of the command; this mapping of known paths to commands is apparently referred to as a set of hashes. I'm not familiar with zsh, but in bash, you could try 'hash -d fzf' to drop the cached known path for fzf (so that the next check will look it up again from scratch), or even 'hash -r' to forget *all* the known paths for everything. I remember reading once upon a time about a command called 'rehash' which would cause the shell to re-check all its cached paths for everything, but that hasn't been available in any *nix environment I've ever actually been running, as far as I'm aware. -- The Wanderer The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore all progress depends on the unreasonable man. -- George Bernard Shaw
signature.asc
Description: OpenPGP digital signature