From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <96078619210714.tru64-unix-managers.marc@archive.invalid> From: dyang () buckeye ! cb ! lucent ! com Date: Wed, 26 Nov 1997 18:39:05 +0000 To: tru64-unix-managers Subject: controlling xterm by "expect" X-MARC-Message: https://marc.info/?l=tru64-unix-managers&m=96078619210714 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@buckeye.cb.lucent.com