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.