help-bash
[Top][All Lists]
Advanced

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

Re: What can affect whether a comamnd is found in PATH?


From: Greg Wooledge
Subject: Re: What can affect whether a comamnd is found in PATH?
Date: Thu, 24 Jun 2021 09:58:20 -0400

On Thu, Jun 24, 2021 at 09:19:03AM -0400, Jeffrey Walton wrote:
> Use 'command -v' to locate a command, not 'type' or 'which' or other
> random things you find on Stack Overflow.

"type" is fine; this is help-bash, so it's sensible to use bash features.
(I agree that which(1) should never be relied on.)  In fact, "type -a"
can be a wonderful diagnostic tool, in case you've got multiple versions
of something without realizing it.

In Peng Yu's case, there are almost certainly some hash shenanigans
going on, and they probably installed and deleted programs, invalidating
bash's command cache, but they will never tell you that.  Just like
they won't tell you the name of the command they're looking for, or the
directory they put it in, or the contents of "$PATH".  They won't show
ls -l output of the absolute path to the program so we can see the
permissions, or do *anything* else that would help us solve their
actual problem.

If you choose to interact with this person, take these warnings into
consideration.



reply via email to

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