我正在編寫一個期望腳本,我必須爲期望傳遞多個發送命令。因爲我期待「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