灌溉梦想,记录脚步
标签类目:ftp

FTP自动登录脚本

这个是简洁脚本:

1
2
3
4
5
6
7
8
9
10
11
#!/usr/bin/expect -f 
spawn ftp ftp.forzw.com 
expect "Password: " 
send -- "passwd\r" 
expect "ftp.forzw.com\r\r" 
Last login: Sun Apr 1 21:32:36 2012 from localhost.localdomain\r\r ]0; " 
send -- "cd /pub/test\r" 
expect "\r /pub/test\r" 
send -- "get program.test\r" 
expect "File transfered" 
send -- "exit\r"

继续阅读 »