I was trying to use "expect" to bring up a new xterm
and control it -- get input and send output.
I ran it on DU 4.0A.
The following is the script I used:
======================================================
#!../expect --
spawn -pty
stty raw -echo < $spawn_out(slave,name)
regexp ".*(.)(.)" $spawn_out(slave,name) dummy c1 c2
if {[string compare $c1 "/"] == 0 } \
{ set c1 "0" }
puts "$dummy $c1 $c2 $spawn_out(slave,name)\r\n"
set pid [exec xterm -S$c1$c2$spawn_out(slave,fd) &]
close -slave
======================================================
And, I got output as the following:
======================================================
spawn
/dev/pts/6 0 6 /dev/pts/6
# xterm: Error 11, errno 9: Bad file number
======================================================
Anybody has any exerience about it?
Thanks,
Daniel
---------------------
Daniel Yang
dyang_at_buckeye.cb.lucent.com
Received on Wed Nov 26 1997 - 20:01:58 NZDT