bug-bash
[Top][All Lists]
Advanced

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

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


From: Dan Church
Subject: Bug: Subshell won't continue after .-sourcing a file
Date: Wed, 21 Dec 2022 16:07:51 -0600
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.6.0

Hi!

I have definitely found a bug in bash. I have a git commit that adds a test for this already:

https://codeberg.org/h3xx/bash/commit/e573113317895072fd5c4641bf6d196875f5cc2d

After fixing the issue, I'd be glad if you would include my git commit as a way of crediting me with the discovery. *Please utilize git properly to do this* via either cherry-pick or merge; don't attribute my commit to your name. If you need help using git, I'd be happy to help you.

This bug was introduced in commit 74091dd4e8086db518b30df7f222691524469998 (found using git bisect). Unfortunately that commit contains way too many changes to pinpoint what change to what file broke it.

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.

I'm no C programmer or I'd fix this myself.

--

Regards,
Dan Church
🌎 web: h3xx.github.io <https://h3xx.github.io/>
"If I am to be judged by those who come after me, let me be judged for the truth." — Raistlin Majere


reply via email to

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