Date: Wed, 17 Sep 2025 15:33:31 +0200 (CEST)
From: pourko--- via Bug reports for the GNU Bourne Again SHell
<[email protected]>
Message-ID: <[email protected]>
| Why do you need to "doubt" it, when you can just as easily test it?
You're right I could, but I'm lazy, and Duncan had already done that,
and now Greg has as well. So no need.
| 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
That's the shell which is the parent of test1 - and when test1 (the whole
process group) stops due to attempting to manipulate the tty, it is that
shell that needs to restart it (in foreground) so it can proceed. But
if that shell is waiting for test1 to complete, which it is in that example,
then it is just going to wait forever.
So, which shell are you using for that? You could have easily said in this
reply, but didn't. Nb: it is not relevant what version /bin/bash is.
And while I am here:
[email protected] said:
| I'm not sure exactly what bash is doing here, but I'm guessing it has
| something to do with switching the terminal from canonical mode to raw
| mode...?
I don't look at bash code, but the NetBSD shell sets the "eol" char in
the terminal to the delimiter, so that a read will terminate when that
character is input. My guess is that bash might do the same.
kre