Hello all,
I need to know how to send ctrl-I in send expect script....
Please inform me somebody regarding this problem..
Thanks & Regards,
Vignesh.C
This is a discussion on Expect - handling multiple processes simultaneously - TCL ; Hello, I am learning Expect and having difficulty with handling multiple processes simultaneously. I spawn 2 processes. In pseudo code below, Process2 ends first and sends an EOF to expect block and expect returns. However, Process 1 is still running ...
Hello,
I am learning Expect and having difficulty with handling multiple processes simultaneously. I spawn 2 processes. In pseudo code below, Process2 ends first and sends an EOF to expect block and expect returns. However, Process 1 is still running and I would like for it to process output from Process 1 and wait for it execution to end.
expect {
-i $Process1
-re "junk" { p1action1 ; exp_continue }
-re "foo1" { p1action2 ; exp_continue }
eof { exp_continue; #Process 2 may not be finished yet!}
-i $Process2
-re "123456" { p2action1 ; exp_continue }
-re "dummy" { p2action2 ; exp_continue }
eof { exp_continue; #Process 1 may not be finished yet! }
}
For example, if I run exp_continue command to handle EOF for Process2 then expect throws following error message:
"expect: spawn id exp9 not open"
exp9 is id associated with Process2 - the process that sent EOF. How can this issue be addressed?
Thanks
Hello all,
I need to know how to send ctrl-I in send expect script....
Please inform me somebody regarding this problem..
Thanks & Regards,
Vignesh.C
Sample code:
# Does not wait for user to hit Enter after Ctrl+L
stty raw -echo
send_user "Enter Ctrl+L: "
expect_user -re "\014" { puts "You hit Ctrl+L key!" }
# Waits for user to user to hit Enter AFTER Ctrl+L has been hit
stty -raw echo
send_user "Enter Ctrl+L and hit Enter: "
expect_user -re "\014" { puts "You hit Ctrl+L key!" }
Hope this helps.