TCLUG Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [TCLUG:2010] automatic telnet etc



Perfect! Thank you so much!

Ben Luey
lueyb@carleton.edu
ICQ: 19144397

On Sat, 31 Oct 1998 barnabas@pobox.com wrote:

> -> Thanks. Expect is definetly the way to go. I've got one problem though,
> -> when the finish the expect script (i.e. I have logged in) except closes
> -> all spawned processes, which means I lose my connection to the server.
> -> I've tried ending the expect script with "close -noexit" but doesn't work.
> -> Maybe I need to run the expect script after starting the telnet session,
> -> but I don't know how to do that. (neither login&;telnet ip nor 
> -> telnet&;login work)
> 
> Try inserting the 'interact' command at the end of your script.
> According to the man page, this "gives control of the current process
> to the user, so that keystrokes are sent to the current process, and
> the stdout and stderr of the current process are returned."
> 
> Then, I believe, when you terminate the process (your telnet session),
> the interact command will terminate and so will the expect script.
> There are fancier ways to use interact, but this is probably all
> you'll need.
> 
> For more information and ways to use expect in unexpected ways (pun
> intended), the O'Reilly book is a good source.
> 
> Hope this helps,
> 
> Eric
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tclug-list-unsubscribe@listserv.real-time.com
> For additional commands, e-mail: tclug-list-help@listserv.real-time.com
> Try our website: http://tclug.real-time.com
>