我正在编写一个期望脚本,我必须为一个期望传递多个发送命令。因为我期待所有发送命令都“OK”。
#!/usr/bin/expect
{
set timeout 5
spawn ssh .......
expect "OK"
send "set connections 10\r"
send "INCR connections\r"
send "INCR connections\r"
send "INCR connections\r"
expect eof
}
这会引发以下错误
invalid command name "
set timeout 5
spawn .......
expect "OK"
send "set connections 10\r"
send "INCR connections\r"
expect eof
"
while executing
"{
set timeout 5