文章详情

  • 游戏榜单
  • 软件榜单
关闭导航
热搜榜
热门下载
热门标签
php爱好者> php文档>linux下自动登陆ftp下载文件

linux下自动登陆ftp下载文件

时间:2006-12-30  来源:shinewaysoft

操作系统:linux 说明:使用了expect,参数为ftp服务器地址和要下载的文件名 参数:lindex $argv 0  读取ftp服务器ip地址      lindex $argv 1  读取要下载的文件名 编辑: #vi ftp.sh spawn ftp [lindex $argv 0]
expect "Name (*):"
send "anonymous\r"
expect "Password:*"
send "\r"
expect "ftp>"
send "binary\r"
expect "ftp>"
send "hash\r"
expect "ftp>"
send "get [lindex $argv 1]\r"
expect "* Transfer complete."
send "exit\r"
执行方法:expect ftp.sh 服务器ip地址  文件名称         (expect ftp.sh 192.168.0.1 filename.txt )   扩展:可以根据需要把用户名和密码也作为参数输入里边,这个根据个人需求去做
相关阅读 更多 +
排行榜 更多 +
武士刀之战

武士刀之战

休闲益智 下载
闲置肥皂切割

闲置肥皂切割

休闲益智 下载
大航海时代2

大航海时代2

休闲益智 下载