Re: When a hashed pathname is deleted, search PATH
From:
Reuben Thomas
Subject:
Re: When a hashed pathname is deleted, search PATH
Date:
Tue, 18 Mar 2014 11:01:08 +0000
On 18 March 2014 08:04, Linda Walsh <bash@tlinx.org> wrote:
>
>
> Chet Ramey wrote:
>
>> Because the execution fails in a child process. You'd be able to fix it
>> for that process, but would do nothing about the contents of the parent
>> shell's hash table.
>>
>> The way the option works now is to check the hash lookups and delete
>> anything that is no longer an executable file, then redo the lookup and
>> hash the new value.
>>
> ----
> Wouldn't bash notice that the child exited in <.1 seconds (
> or is it less?
>
Timing is not something you could rely on, though.
The child could report failure by e.g. writing through a pipe to the
parent, as in
http://stackoverflow.com/questions/2719499/c-signal-parent-process-from-childthereby
letting the parent update its hash table, but it's not clearly
worth the extra complexity to remove the small overhead.