标签:use ESS The expect shel cal bin div host
yum -y install expect vim ftp_upload.sh #!/usr/bin/expect spawn ftp localhost expect "Name*" send "ftp\n" expect "ftp>*" send "cd pub/other\n" expect "ftp>*" send "put /tmp/123.txt xo.txt\n" expect { "150 Ok to send data" { send_user "upload sucessfull!";send "quit\n" } #send_user 类型shell的echo命令 "553*" { send_user "upload error!";send "quit\n" } } expect eof 加权限 chmod +x ftp_upload.sh 执行命令 ./ftp_upload.sh
标签:use ESS The expect shel cal bin div host
原文地址:https://www.cnblogs.com/gaiting/p/12149191.html