On Sun, Oct 31, 2021 at 10:26 PM Mike Jonkmans <bash...@jonkmans.nl> wrote: > POSIX is also silent on this.
I think ``Once a utility has been searched for and found [...], an implementation may remember its location and need not search for the utility again unless the PATH variable has been the subject of an assignment'' pretty much covers it. `command -p command_name' doesn't alter `PATH', and the shell may or may not remember the location of `command_name' obtained using the default value for `PATH'. > Note that it is not always the same person writing the code. > The script might be written/changed by someone unaware of the side effects. > I assume script writers would know about PATH and alias effects, > less so about 'hash' and even fewer people would know about 'command -p'. Yeah, it'd be better if the feature in question were documented.