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

Re: Tips/advice for installing latest version of fzf?



On Tue, Aug 31, 2021 at 02:20:12PM -0400, Steve Dondley wrote:
> Ok, it is there after all, as a built-in. I was mindlessly trying "sudo hash
> -d fzf". I guess trying with sudo doesn't work.
> 
> "sudo which hash" shows nothing. Not sure whey.

sudo is an external program, which launches other external programs.

When you type "sudo which hash", your shell (zsh) forks a child, and
that child executes "sudo".  sudo does its authentication/authorization
dance, and then executes "which hash", looking for an external command
in $PATH.  It will find /usr/bin/which, and it will run that.

So effectively, you're running sudo /usr/bin/which hash.

/usr/bin/which, being an external program, has no concept of shell
builtins.  It can only look for other external programs.  And there is
no program named hash.  Only shell builtins.

You would get a similar non-answer if you ran "/usr/bin/which hash"
in your shell.  The sudo part doesn't change anything, since there are
no directories in $PATH that require superuser privileges to search.
At least, there shouldn't be.


Reply to: