Thank you! Yup, that was what I was looking for.. When I read through
the man page, it had all these things like expect_user, etc. and I
couldn't really get what to do. But its working now! Thanks again, to
everyone who helped me!

        Bryan


On Thu, 14 May 1998, Mike A. Lewis, CNE wrote:

|
|At the point in your script where you want to take control, put the
|expect command "interact" as in the example below:
|
|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"
|interact
|
|Hope that answers your question,
|Mike
|
|-----Original Message-----
|From:  GateKeepeR News [mailto:[EMAIL PROTECTED]]
|Sent:  Thursday, May 14, 1998 2:40 AM
|To:    Fred Lenk
|Subject:       Re: expect? (offtopic)
|
|Well, it seems to work at first, but it closes the telnet session.. How
|do I get it to just stop and let me do what I want to do? 
|
|
|On Wed, 13 May 1998, Fred Lenk wrote:
|
||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.
|
|
|-- 
|  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.
|


-- 
  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