EXPECT实例 全自动ftp匿名登录,下载文件并退出
[root@z ~]# rpm -qa | grep expect
[root@z ~]# yum install expect -y
[root@z ~]# vi ftptest.sh
#!/usr/bin/expect
spawn ftp 192.168.1.202
expect "Name"
send "ftp\r"
expect "Password:"
send "nothing\r"
expect "Login successful"
send "cd pub\r"
expect "successfully changed"
send "get shc-3.8.6.tgz\r"
expect "send OK"
send "quit\r"
[root@z ~]# chmod 700 ftptest.sh
[root@z ~]# ./ftptest.sh
顶一下
(0)
0%
踩一下
(0)
0%
------分隔线----------------------------
- 上一篇:没有了
- 下一篇:linux内核编程初探!
- 最新评论 查看所有评论
-
- 发表评论 查看所有评论
-
