ARGS="-m"
GOOD=0
EVALFN=1
KILLFN=1

rm -f misc.tmp ready.tmp typescript.tmp

./got-no-tty
# this'll do but... WHERE ARE THE MAN PAGES FOR PTY STUFF???
(SHELL=`pwd`/script-child script typescript.tmp &>/dev/null) &
while [ ! -f ready.tmp ] ; do sleep 0.01 ; done
. ready.tmp

evalfn () {
   THIS_TTY=`tty | colrm 1 5`
   lines1=`awk '{print $2}' < stdout | sort -u | egrep "^($THIS_TTY)$"               | wc -l`
   lines3=`awk '{print $2}' < stdout | sort -u | egrep "^($SHELL_TTY|$THIS_TTY|\?)$" | wc -l`
   [ $lines1 == 1 ] && [ $lines3 == 1 ]
}

killfn () {
  killall -9 got-no-tty
  kill -9 $SHELL_PID  # the others should freely die
  rm -f misc.tmp ready.tmp typescript.tmp
}
