controlling xterm by "expect"

From: <dyang_at_buckeye.cb.lucent.com>
Date: Wed, 26 Nov 1997 13:39:05 -0500

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

This archive was generated by hypermail 2.4.0 : Wed Nov 08 2023 - 11:53:37 NZDT