中国开发网: 论坛: 程序员情感CBD: 贴子 471145
有狐
谁熟悉tclsh啊,帮我写个能在Windows下运行的通过FTP取文件的例子吧,谢谢
我参照Demo写了一个,不正确,不知道是不是在Windows下运行写法不太一样啊
哪位兄弟比较熟帮我写个,懒得弄了,
最好能写成可以传其他参数进去的


#!/bin/sh
# \
exec tclsh "$0" ${1+"$@"}
package require Expect
set timeout 60
spawn ftp "82.0.111.11"
expect "User*:"
send "Administrator\r"
expect "Password:"
send "pppppp\r"
expect "ftp>"
send "binary\r"
expect "ftp>"
#send "cd inet/rfc\r"
expect "550*ftp>" exit "250*ftp>"
send "get xxxxxxx.txt\r"
expect "550*ftp>" exit "200*226*ftp>"
close
wait

相关信息:


欢迎光临本社区,您还没有登录,不能发贴子。请在 这里登录