On Wed, Sep 17, 2025 at 15:33:31 +0200, pourko--- via Bug reports for the GNU Bourne Again SHell wrote: > Robert Elz wrote: > > I think a better question would be, which shell is being > > used to run ./test0 & wait and ./test1 & wait. > > > > The implication is that it also is bash, but I doubt bash would > > act as described. > > Why do you need to "doubt" it, when you can just as easily test it? > Also, if you notice there is a "#!/bin/bash" in each of the examples.
The shebang tells us what shell is interpreting the script, but not what shell was used to issue the "./test1 & wait" command. Robert's point was that the behavior of "wait" which you describe occurs only in shells other than bash. However, I don't think this is the real focus of your bug report. If I'm understanding you correctly, you don't actually care that the "wait" process hangs indefinitely in your non-bash interactive shell. What you care about is the fact that the bg script has gone into the "stopped" state, with no chance of ever returning from that state unless the end user takes action.