On Wed, Sep 17, 2025 at 16:37:55 +0200, pourko--- via Bug reports for the GNU Bourne Again SHell wrote: > Robert Elz wrote: > > > Also, if you notice there is a "#!/bin/bash" in each of the examples. > > > > That's irrelevant, that's not the shell that is causing the issue. > > What matters is which shell you are using to run those scripts, that > > is the one in which you're doing > > ./test1 & wait > > I see what you mean. In my earlier posting, (and in my actual use-case), > these are two functions, which get called from within the same bash script. > I get the same results when I run that script with bash 5.2.37 and 5.3.3. > I thought that it would be simpler if I post them as two scripts here.
Since you're running the commands from a bash script, rather than a bash interactive shell, job control is disabled (unless you've turned it on). I believe that accounts for the difference from the expected behavior of "wait".
