Вот такой код,но почему-то не весь работает
1 set ip "$argv 1"
2 spawn ssh ubuntu@192.168.56.$ip
3 #expect "Are you sure you want to continue connecting (yes/no)?"
4 #send "yes\r"
5 expect "password:"
6 send "ubuntu\r"
7 expect "ubuntu@db$ip:~$"
8 send "sudo apt-get install mongodb\r"
9 expect "password for ubuntu:"
10 send "ubuntu\r"
11 expect "Do you want to continue ?"
12 send "y\r"
13 expect "ubuntu@db$ip:~$"
14 send "mkdir db\r"
15 expect "ubuntu@db$ip:~$"
16 send "sudo service mongodb stop\r"
17 expect "ubuntu@db$ip:~$"
18 send "mongod --dbpath db1 --port 27001 --replSet myreplica\r"
19 interact
20 expect eof
Не все строки выполняются,подскажите пожалуйста как сделать так что бы выполнялись все.Не выполняется начиная с 13-ой строки,ошибок не выдаёт,заранее спасибо.