POSIX 2.9.1.1:
"If the remembered location fails for a subsequent invocation, the shell shall
repeat the search to find the new location for the utility, if any."

Le 28 novembre 2025 00:34:43 GMT+01:00, Brandon Allbery <[email protected]> a 
écrit :
>It's a POSIX-ism. I wasn't paying attention during the 13.x days (last time
>I did fbsd was around 5-CURRENT) but I suspect someone pushed for POSIX
>compliance.
>
>On Thu, Nov 27, 2025 at 6:12 PM np <[email protected]> wrote:
>
>> Probably but I was surprised this is not the same behaviour under 13.x. Or
>> a default option has changed in sh ?
>>
>> Somewhat strange that a non-existing file does not reset the hash table
>> automatically!
>>
>>
>> Le 28 novembre 2025 00:02:05 GMT+01:00, Brandon Allbery <
>> [email protected]> a écrit :
>>
>>> Don't you have to 'hash -r' after moving cached executables?
>>>
>>> On Thu, Nov 27, 2025 at 6:00 PM np <[email protected]> wrote:
>>>
>>>> Hi,
>>>>
>>>> for example, given a script /usr/local/bin/a.sh which outputs "ok", then
>>>> login to a console as root (for simplicity):
>>>>
>>>> root# a.sh
>>>> ok
>>>> root# mv /usr/local/bin/a.sh /usr/bin
>>>> root# a.sh
>>>>
>>>> On 15.0-RC4, sh will report here that a.sh is not found, even if PATH
>>>> has /usr/bin. But csh will find it.
>>>>
>>>> On 13.3 the script is found normally (did not check it on 14.x).
>>>>
>>>> Same thing for whatever program you want. Can you confirm this behaviour
>>>> ?
>>>>
>>>> Cordialement,
>>>> N.P.
>>>>
>>>
>>>
>>>
>
>-- 
>brandon s allbery kf8nh
>[email protected]

Reply via email to