bug-bash
[Top][All Lists]
Advanced

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

Re: Bug: Subshell won't continue after .-sourcing a file


From: Chet Ramey
Subject: Re: Bug: Subshell won't continue after .-sourcing a file
Date: Thu, 22 Dec 2022 12:18:35 -0500
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.6.0

On 12/21/22 11:44 PM, Oğuz wrote:
22 Aralık 2022 Perşembe tarihinde Dan Church <h3xx@gmx.com> yazdı:

Repro:

    sub1=$(mktemp)
    sub2=$(mktemp)
    sub3=$(mktemp)

    echo '( echo "1st script executing" ; . '"$sub2"' ; echo "1st script
still executing" )' >"$sub1"
    echo 'echo "2nd script starting" && ${THIS_SH} '"$sub3" >"$sub2"
    echo 'echo "3rd script starting"' >"$sub3"

    . "$sub1"

"1st script still executing" will never be printed.


Or

     $ bash -c '(. <(echo ": && uname"); echo x)'
     Linux
     $

x is never printed. Looks like another bug caused by aggressive subshell
optimizations

Thanks for the reports, both of you. I've attached a patch.

Chet

--
``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU    chet@case.edu    http://tiswww.cwru.edu/~chet/

Attachment: evalfile-optimize
Description: Text document


reply via email to

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