Find the answer to your Linux question:
Results 1 to 4 of 4
Hi how can i install Expect command? and where can i find it? iam using redhat 9 any help...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Nov 2004
    Posts
    20

    how to install Expect command?


    Hi
    how can i install Expect command? and where can i find it?

    iam using redhat 9

    any help

  2. #2
    Just Joined!
    Join Date
    Jun 2004
    Location
    London, UK
    Posts
    53
    Why don't you give the expect RPM a go?

  3. #3
    Just Joined!
    Join Date
    Nov 2004
    Posts
    20
    Hi
    thanks i found it :P

    but i have problem , i did this script to log and reset my router , but its keep resting the router all the time, its working as a loop; how can i make it run for 1 time

    i am new therefor i need your help
    Thank you

    Code:
    #!/usr/local/bin/expect
    # reset Dlink /router
    
    # set these variables for your network
    set router "192.168.1.1"
    set passwd "admin"
    set rta_prompt "#>"
    
    eval spawn telnet "$router"
    expect "password:"	{send "$passwd\r"}
    expect	"$rta_prompt"	{send "reboot\r"}
    sleep 2
    send "\r"

  4. #4
    Just Joined!
    Join Date
    Dec 2004
    Location
    india
    Posts
    1
    expect "]:"
    send "/bin/tcsh\n"
    expect eof

    i guess u can figure out why it was in a loop from this ..

    P.S :- Really i have a feeling i am very late with this reply. Since i didn't see any reply on this .. i thought u might stil be looking for an answer ..

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •