Problem using Xterm in Expect script



Hi,

I have written a script which will spawn an xterm and executes the
specified expect script .I wanna know how can i pass an interrupt
signal to the spawned xterm to stop the test1 and then switch to
test2.Plz do reply.

Here is my script.when i execute the script s1.exp .Everything goes
fine ,in the "quall" procedure i check for an error 60 sec if it
doesn't occcur then i want to stop the "quall test" and switch to the
"rwc test"

-------------------------------------------------------------------------------

s1.exp
#!/usr/bin/expect

spawn xterm -e sdauto.exp mmc11;sleep 2
spawn xterm -e sdauto.exp mmc12;sleep 2
spawn xterm -e sdauto.exp mmc13;sleep 2

sdauto.exp
#!/usr/bin/expect
spawn $env(SHELL)

set machine [lindex $argv $i]

proc remotelogin {machine} {
send "rsh $machine -l local\r"
set timeout 20
expect -ex "Password: "
send "local\r"
expect "local*"
}


proc quall {} {
#qualloop test
send -- "quall -i=150 -b=250 -e=100 -t=2\r"
set timeout 60
expect "Error*" {puts "----quall FAILED------"}
send -h "^C"
#-------------------------------------------------------------------after
executing ctrl C the Xterm is closed ,but i wanna stop quall test and
got to rwc test
expect "local@*"
}

proc rwc {} {
send -- "rwc.py -fmc.config\r"
set timeout 60
expect "Error"
send -h "^C"
expect "local*"
}

remotelogin $machine
qualloop
rwc
--------------------------------------------------------------------------------

Regards
Girish

.



Relevant Pages

  • Problem using Xterm in Expect script
    ... I have written a script which will spawn an xterm and executes the ...
    (comp.unix.solaris)
  • Problem using Xterm in Expect script
    ... I have written a script which will spawn an xterm and executes the ...
    (comp.unix.shell)
  • Re: gui scripting
    ... I want to write a script which runs number of xterms and executes ... interactive xterm. ... If you want to run an interactive script in that xterm: ...
    (comp.unix.shell)
  • Re: John Resig Video
    ... that it should only be used on script resources where it ... That fulfills the "doesn't matter when it executes" statement. ... And in environments were defer is not implemented that same script is going to processed inline and so be executed before the DOM is complete, which could still happen even if defer is implemented as "can continue ...
    (comp.lang.javascript)
  • Files appear to be cross linked
    ... script requires a number of standard environment variables to be set ... so it calls a second shell script to set these at the session level, ... control should return to the first shell script, ... that the script executes to the last line prior to the displaying of ...
    (comp.unix.solaris)