On 12/21/22 11:44 PM, Oğuz wrote:
22 Aralık 2022 Perşembe tarihinde Dan Church <h...@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 c...@case.edu http://tiswww.cwru.edu/~chet/
*** ../bash-5.2-patched/builtins/evalfile.c 2019-07-20 16:16:08.000000000
-0400
--- builtins/evalfile.c 2022-12-22 12:13:08.000000000 -0500
***************
*** 267,271 ****
/* set the flags to be passed to parse_and_execute */
! pflags = SEVAL_RESETLINE;
pflags |= (flags & FEVAL_HISTORY) ? 0 : SEVAL_NOHIST;
--- 267,271 ----
/* set the flags to be passed to parse_and_execute */
! pflags = SEVAL_RESETLINE|SEVAL_NOOPTIMIZE;
pflags |= (flags & FEVAL_HISTORY) ? 0 : SEVAL_NOHIST;