FTP using expect
- From: "Ranjan" <ranjan.kapoor@xxxxxxxxx>
- Date: 26 Mar 2006 22:39:25 -0800
Hello,
I am new to Expect.( This is a very basic expect program, please let me
know if there is a
separate group where I can post this query)
I am simply trying to ftp my local mail server , entering username and
password read from a file and then exitting.
Sometimes this program runs fine till the end and exits properly, but
sometimes it hangs in between. Like sometimes after entering user name
, or sometimes after entering passowrd or sometimes during ftp to the
server.
Following is the program, please let me know if there is something
wrong with the program.
I tried it on various server and even tried telnet program but face the
same problem.
#!c:/Tcl/bin/tclsh
package require Expect
spawn ftp indmail
set timeout -1
set file [open "C:/Tcl/bin/password.txt" "r"]
gets $file username
gets $file password
expect "User*"
send "$username\r"
expect "Password:"
send "$password\r"
expect "ftp>"
send "binary\r"
expect "ftp> "
send "bye\r"
.
- Follow-Ups:
- Re: FTP using expect
- From: vinayak.mdesai@xxxxxxxxx
- Re: FTP using expect
- From: Uwe Klein
- Re: FTP using expect
- Prev by Date: Re: Can TCL/Tk do WYSIWYG?
- Next by Date: Re: Can you give me some advise in testing?
- Previous by thread: Can TCL/Tk do WYSIWYG?
- Next by thread: Re: FTP using expect
- Index(es):
Relevant Pages
|