过去,我是在写expect脚本来实现自动登陆并上传下载文件。不过略感不顺。
参考文档:
http://blog.chinaunix.net/uid-20526681-id-3549245.html
现在有一个好的方法
cd 到本地你要上传或下载的目录中
ftp -niv << EOF
open ip_address
user username password
ascii
put filename
bye
EOF
实例:
cd /home/ctgmkt
ftp -niv << EOF
open 192.168.124.11
user yhl yhl
ascii
put tefile.txt
bye
EOF