Well, I use expect in my dialup email server, but not to establish 
the connection. I'm using the following to dialup:

#PPP command with built in chat script 
/usr/sbin/pppd connect '/usr/sbin/chat -v "" ATZ OK AT\&F1 OK
ATDT1-nnn-nnn-nnnn CONNECT "" ogin: your_login_id word: your_password'
/dev/modem 115200 crtscts modem lock noipdefault  kdebug 0 

Note that my emailer has broken up the original single line, starting 
with /usr/sbin/pppd, into several lines. yours must be all one line 
in the shell script. This gets my foot in the door of my ISP, but not 
necessarily to a telnet prompt.


Then a little later in the script, I use expect to telnet to the 
host on a non standard telnet port (NN) to accomplish my objectives. 
I've modified it a bit so as to not give out passwords or the host 
I'm dealing with, or what im doing.

expect << EOcmds
         spawn telnet some.isp.com NN
         expect "some string you expect "
         send "my reply string"
         expect "some string you expect"
         send "my reply string"
         expect "some string you expect"
         send "quit\n"

EOcmds

let me know if that helps
fred


> Date:          Wed, 13 May 1998 02:50:29 -0700
> From:          "Gate News" <[EMAIL PROTECTED]>
> To:            <[EMAIL PROTECTED]>
> Subject:       expect? (offtopic)

> Would anyone happen to have a script that automaticall logs into a
> machine via telnet? I would like to have to so I click my icon, and it
> just connects and logs in.. I was told to use expect but I cant quite
> get it to work..
> 
> Also, does anyone know of a way to import a larg number of users
> (~700) into linux users? instead of adduser/passwd <user> for
> everyone?
> 
> TIA
> 
>     Bryan
> 
> 
Fred Lenk, SysAdmin, CommPower
mailto:[EMAIL PROTECTED]
http://www.commpower.com - Check jobs posting.


-- 
  PLEASE read the Red Hat FAQ, Tips, Errata and the MAILING LIST ARCHIVES!
http://www.redhat.com/RedHat-FAQ /RedHat-Errata /RedHat-Tips /mailing-lists
         To unsubscribe: mail [EMAIL PROTECTED] with 
                       "unsubscribe" as the Subject.

Reply via email to