Example

This simple example illustrates logging in to a host using anonymous FTP and then passing control back to the user:

set host localhost
     set name myname@myhost
     spawn ftp $host
     expect "Name (*):"
     send "anonymous
"
     expect "Password:"
     send "$name
"
     expect {
        "ftp>" {
         interact
        }
        "Login failed." {
            exit 1
        }
        timeout {
            exit 1
        }
}
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset