script(1) uses three processes (doinput, dooutput and doshell). It's
possible that the shell process is finished before the input and
output processes are completely initialized. For example:
$ script -c "printf Bingo"
In particular case the output and input processes read/write data from
shell process in time when the shell process is already done -- so it
hangs on read().
The second problem is that the output process can finish although
there are unread data from finished shell process -- an output in
the typescript file and on terminal is incomplete!
script(1) has to pass:
$ for i in `seq 1 1000`; do script -q -c "printf 'Bingo\n'"; done | grep -c Bingo
1000