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

Re: [TCLUG:2010] automatic telnet etc



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)

Thanks,

Ben


> You should try using expect for your automatic telnet.  It's really easy
> to use.  The October Linux Journal had an article on it.  It took me 20
> minutes to learn, and it's great!
> 
> To get started:
> 
> # autoexpect -f filename telnet machinename.domain.net
> 
> will make a file called filename.  Edit the file to remove garbage or
> things that don't look the same each time (i.e. dates and motd
> continuously change and expect expects _exact_ strings of text).
> 
> Then run
> 
> # expect filename
> 
> That should log you on to machinename.domain.net.  You'll probably want to
> make filename readable by nobody but you since it contains your password. 
> Be careful. 
> 
> Hth,
> Chris
> 
> 
> On Thu, 29 Oct 1998, Ben Luey wrote:
> 
> > because I can just keep hearing empty. My other problem is that I can't
> > get telnet to automatically login I can give it the username, but there
> > isn't a switch for password. Right now, it just gives up after a while and
> > disconnects from the server, unless I can type the password in time. 
> 
> 
> ---------------------------------------------------------------------
> 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
>