ftp 交互脚本
Posted gaiting
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了ftp 交互脚本相关的知识,希望对你有一定的参考价值。
expect ftp 交互
yum -y install expect vim ftp_upload.sh #!/usr/bin/expect spawn ftp localhost expect "Name*" send "ftp " expect "ftp>*" send "cd pub/other " expect "ftp>*" send "put /tmp/123.txt xo.txt " expect { "150 Ok to send data" { send_user "upload sucessfull!";send "quit " } #send_user 类型shell的echo命令 "553*" { send_user "upload error!";send "quit " } } expect eof 加权限 chmod +x ftp_upload.sh 执行命令 ./ftp_upload.sh
以上是关于ftp 交互脚本的主要内容,如果未能解决你的问题,请参考以下文章