すべての送信コマンドに対して「OK」を期待しているため、expectのために複数の送信コマンドを渡す必要があるexpectスクリプトを作成しています。
#!/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