• Re: 15.0-RC4: sh failing to find a file

    From np@dev@nicolas-provost.fr to muc.lists.freebsd.stable on Fri Nov 28 11:05:07 2025
    From Newsgroup: muc.lists.freebsd.stable

    ------F7V3M3HXW1RU661Y5MDYUOWFSTUIU9
    Content-Type: text/plain;
    charset=utf-8
    Content-Transfer-Encoding: quoted-printable

    POSIX 2=2E9=2E1=2E1:
    "If the remembered location fails for a subsequent invocation, the shell s= hall
    repeat the search to find the new location for the utility, if any=2E"

    Le 28 novembre 2025 00:34:43 GMT+01:00, Brandon Allbery <allbery=2Eb@gmail= =2Ecom> a =C3=A9crit=C2=A0:
    It's a POSIX-ism=2E I wasn't paying attention during the 13=2Ex days (las=
    t time
    I did fbsd was around 5-CURRENT) but I suspect someone pushed for POSIX >compliance=2E

    On Thu, Nov 27, 2025 at 6:12=E2=80=AFPM np <dev@nicolas-provost=2Efr> wro=
    te:

    Probably but I was surprised this is not the same behaviour under 13=2E= x=2E 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 <
    allbery=2Eb@gmail=2Ecom> a =C3=A9crit :

    Don't you have to 'hash -r' after moving cached executables?

    On Thu, Nov 27, 2025 at 6:00=E2=80=AFPM np <dev@nicolas-provost=2Efr> = wrote:

    Hi,

    for example, given a script /usr/local/bin/a=2Esh which outputs "ok",=
    then
    login to a console as root (for simplicity):

    root# a=2Esh
    ok
    root# mv /usr/local/bin/a=2Esh /usr/bin
    root# a=2Esh

    On 15=2E0-RC4, sh will report here that a=2Esh is not found, even if = PATH
    has /usr/bin=2E But csh will find it=2E

    On 13=2E3 the script is found normally (did not check it on 14=2Ex)=
    =2E

    Same thing for whatever program you want=2E Can you confirm this beha= viour
    ?

    Cordialement,
    N=2EP=2E





    --=20
    brandon s allbery kf8nh
    allbery=2Eb@gmail=2Ecom

    ------F7V3M3HXW1RU661Y5MDYUOWFSTUIU9
    Content-Type: text/html;
    charset=utf-8
    Content-Transfer-Encoding: quoted-printable

    <html><head></head><body><div dir=3D"auto">POSIX 2=2E9=2E1=2E1:<br>"If the = remembered location fails for a subsequent invocation, the shell shall<br>r= epeat the search to find the new location for the utility, if any=2E"</div>= <br><br><div class=3D"gmail_quote"><div dir=3D"auto">Le 28 novembre 2025 00= :34:43 GMT+01:00, Brandon Allbery &lt;allbery=2Eb@gmail=2Ecom&gt; a =C3=A9c= rit=C2=A0:</div><blockquote class=3D"gmail_quote" style=3D"margin: 0pt 0pt = 0pt 0=2E8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"=

    <div dir=3D"ltr">It's a POSIX-ism=2E I wasn't paying attention during the = 13=2Ex days (last time I did fbsd was around 5-CURRENT) but I suspect someo=
    ne pushed for POSIX compliance=2E</div><br><div class=3D"gmail_quote gmail_= quote_container"><div dir=3D"ltr" class=3D"gmail_attr">On Thu, Nov 27, 2025=
    at 6:12=E2=80=AFPM np &lt;<a href=3D"mailto:dev@nicolas-provost=2Efr">dev@= nicolas-provost=2Efr</a>&gt; wrote:<br></div><blockquote class=3D"gmail_quo= te" style=3D"margin:0px 0px 0px 0=2E8ex;border-left:1px solid rgb(204,204,2= 04);padding-left:1ex"><div><div dir=3D"auto">Probably but I was surprised t= his is not the same behaviour under 13=2Ex=2E Or a default option has chang=
    ed in sh ?<br><br>Somewhat strange that a non-existing file does not reset = the hash table automatically!</div><br><br><div class=3D"gmail_quote"><div = dir=3D"auto">Le 28 novembre 2025 00:02:05 GMT+01:00, Brandon Allbery &lt;<a=
    href=3D"mailto:allbery=2Eb@gmail=2Ecom" target=3D"_blank">allbery=2Eb@gmai= l=2Ecom</a>&gt; a =C3=A9crit&nbsp;:</div><blockquote class=3D"gmail_quote" = style=3D"margin:0pt 0pt 0pt 0=2E8ex;border-left:1px solid rgb(204,204,204);= padding-left:1ex">
    <div dir=3D"ltr">Don't you have to 'hash -r' after moving cached executabl= es?</div><br><div class=3D"gmail_quote"><div dir=3D"ltr" class=3D"gmail_att= r">On Thu, Nov 27, 2025 at 6:00=E2=80=AFPM np &lt;<a href=3D"mailto:dev@nic= olas-provost=2Efr" target=3D"_blank">dev@nicolas-provost=2Efr</a>&gt; wrote= :<br></div><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0= =2E8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><u></u><div= ><div dir=3D"auto">Hi,<br><br>for example, given a script /usr/local/bin/a= =2Esh which outputs "ok", then login to a console as root (for simplicity):= <br><br>root# a=2Esh<br>ok<br>root# mv /usr/local/bin/a=2Esh /usr/bin<br>ro= ot# a=2Esh<br><br>On 15=2E0-RC4, sh will report here that a=2Esh is not fou= nd, even if PATH has /usr/bin=2E But csh will find it=2E<br><br>On 13=2E3 t=
    he script is found normally (did not check it on 14=2Ex)=2E<br><br>Same thi=
    ng for whatever program you want=2E Can you confirm this behaviour ?<br><br= >Cordialement,<br>N=2EP=2E</div></div></blockquote></div><div><br clear=3D"= all"></div><div><br></div></blockquote></div></div></blockquote></div><div>= <br clear=3D"all"></div><div><br></div></blockquote></div></body></html> ------F7V3M3HXW1RU661Y5MDYUOWFSTUIU9--


    --
    Posted automagically by a mail2news gateway at muc.de e.V.
    Please direct questions, flames, donations, etc. to news-admin@muc.de
    --- Synchronet 3.21a-Linux NewsLink 1.2