#!/usr/bin/expect
spawn ftp ftp.internic.net
expect "Name"
send "anonymous\r"
expect "Password:"
send "nothing\r"
expect "ftp>"
send "cd domain\r"
expect " ftp>"
send "get named.root\r"
expect " ftp>"
send "quit\r"
#脚本的目的是登陆ftp.internic.net网站取得named.root文件然后退出#登录.
spawn ftp ftp.internic.net
expect "Name"
send "anonymous\r"
expect "Password:"
send "nothing\r"
expect "ftp>"
send "cd domain\r"
expect " ftp>"
send "get named.root\r"
expect " ftp>"
send "quit\r"
#脚本的目的是登陆ftp.internic.net网站取得named.root文件然后退出#登录.