On 9/17/25 5:05 AM, pourko--- via Bug reports for the GNU Bourne Again
SHell wrote:
RESULTS:
./test0 finishes execution.
./test1 gets stuck after echo "RUNNING", and before echo "RETURNING".
You can look at the process status using ps and see what's going on. It's
already been covered in other messages.
Alternatively, if "-t 1" is going to have some such problems (and if
we decide to call that "normal"), then "-t 0" should be able to
detect such a condition and return with some *meaningful* return code.
What condition is that? `-t 0' only checks whether input is available on
the specified file descriptor.
Alternatively (#2), the [ -t N ] tests should be able to help us avoid it.
Why? If you're running the script from an interactive shell with job
control enabled, the standard input and standard output will be the same
as the parent shell.
Alternatively (#3), there must be some other way to detect such condition,
and avoid getting stuck, without shelling out to external commands.
I think the real problem is the interactive shell you're using doesn't
tell you that the process has stopped.
--
``The lyf so short, the craft so long to lerne.'' - Chaucer
``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU c...@case.edu http://tiswww.cwru.edu/~chet/