1760558 Members
2856 Online
108894 Solutions
New Discussion юеВ

Expect Progam

 
Vasudevan MV
Frequent Advisor

Expect Progam

Hi,

I have written a small expect script which will telnet to a particular ip & will do the login process automatically. Then it launches an application called "hots" on the command prompt. The hots application screen looks like this
1 - Add
2 - Command Prompt
3 - Exit
In the script after issuing "hots" on the command prompt, it interacts with the user. As soon as user selects "3" it should come out from the application & close the telnet session.

The second thing is when the user selects "2" option, the user can see his home directory(application server) & if the user presses ctrl+d on the command prompt, the application getting closed & come back to the same place(telnet session).

Can any one tell me how to handle the above mentioned things in a expect script?

Thanks
Vasu
3 REPLIES 3
harry d brown jr
Honored Contributor

Re: Expect Progam

I'd personally use perl with the expect and telnet modules.

Here is a site describing the use of Expect.pm:

http://aspn.activestate.com/ASPN/CodeDoc/Expect/Expect.html

live free or die
harry
Live Free or Die
Vasudevan MV
Frequent Advisor

Re: Expect Progam

Harry,

Thanks for your quick reply, but I dont have perl on my box. So, I want to do the whole thing in Expect/Tcl script only.

Vasu
harry d brown jr
Honored Contributor

Re: Expect Progam