1832595 Members
3018 Online
110043 Solutions
New Discussion

Expect query

 
Vasudevan MV
Frequent Advisor

Expect query

Hi,

After interacting with the user using "interact" command in Expept script, Can we handle somemore thing after interact command in the Expect like
interact ^Z return
...
expect "hello:" {send "ok" }
expect "simple:" {send "su\r"}
...
if [fork] exit
disconnect
expect eof

Thanks
Vasu
2 REPLIES 2
Steve Steel
Honored Contributor

Re: Expect query

Hi


I think inter_return

look at


http://www.fnal.gov/docs/products/expect/expect.1.html


Actions such as break and continue cause control structures (i.e., for, proc) to behave in the usual way. However return causes interact to return to its caller, while inter_return causes interact to cause a return in its caller. For example, if "proc foo"
called interact which then executed the action
inter_return, proc foo would return. (This means that if interact calls interpreter interactively typing return will cause the interact to continue, whileinter_return will cause the interact to return to its caller.)


steve steel
If you want truly to understand something, try to change it. (Kurt Lewin)
Vasudevan MV
Frequent Advisor

Re: Expect query

Hi Steve,

Thanks for your reply, do you have any sample programs on that?. Basically I have to do some cleanup process after the intraction. So How can I do that?.

Thanks
Vasu