[Top][All Lists]

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

Re: hash not restored after running command -p

From: Oğuz
Subject: Re: hash not restored after running command -p
Date: Mon, 1 Nov 2021 09:09:19 +0300

On Sun, Oct 31, 2021 at 10:26 PM Mike Jonkmans <bashbug@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.

reply via email to

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