On Thu, Oct 09, 2014 at 11:53:15AM +0100, Adam Sampson wrote: > Thorsten Glaser <tg@xxxxxxxxxx> writes: > > > $ script -qc './test.sh -v' </dev/null 2>&1 | tee log > > For me, this doesn't hang, but it does exit before test.sh is actually > finished. Here's a simpler example that does the same thing: > > $ cat simpler.sh > #!/bin/sh > echo one > sleep 2 > echo two > $ script -c './simpler.sh' > Script started, file is typescript > one > two > Script done, file is typescript > $ script -c './simpler.sh' </dev/null > Script started, file is typescript > one > Script done, file is typescript > > The "wait for children" code at the end of doinput looks suspicious to > me -- finish() doesn't actually block, as the comment implies, just hmm.. because WNOHANG, it seems we need a one function for signal handler (with WNOHANG) and another function for the real program termination (without WNOHANG). Karel -- Karel Zak <kzak@xxxxxxxxxx> http://karelzak.blogspot.com -- To unsubscribe from this list: send the line "unsubscribe util-linux" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html