【发布时间】:2017-07-21 16:25:30
【问题描述】:
这是我的脚本:
set pwfl [open "/home/arul/Arul/BPGrep/Rest/Test/p1" r]
set pswd [split [read "$pwfl"] "\n"]
foreach pw \$pswd
log_file [exec date]_Int_Push_FTP.log
spawn ftp oc0151528004 21
set timeout 30
expect "Name (*:*):" {send "arul\r\n"}
expect "*assword:" {send "$pw\r\n"}
expect "ftp>" {send "bye\r\n"}
expect "ftp>" {send "exit\r\n"}
并得到这样的错误:
错误的#args: 应该是“foreach varList list ?varList list ...? 命令” 执行时
“foreach pw \$pswd”(文件“Int_Push_FTP_11Jul.expect”第 4 行)
【问题讨论】: