munish
munish

Reputation: 4634

Interact: spawn id exp0 not open?

i tried to use simply interact as well and also this by removing the last expect staement

    expect -re "$prompt"
    send -- "exit\r"

with

 interact {
     -re "$prompt"
      { send -- "show vlan id 121\r" }
         }

i just want to pass the control to the user to do somtheing manually and when he exits thes rest of the loop continues

Upvotes: 1

Views: 5369

Answers (1)

Rostyslav
Rostyslav

Reputation: 353

To exit from interact user should provide it some command, so it knows when to stop interactive session. For example:

expect -re "$prompt"
send -- "show vlan id 121\r"
send_user "To exit interactive mode press Ctrl+C\n"
interact \003 return
send "show ip int br | ex una\r"
expect "#"
send "exit\n"; exit 0

Upvotes: 3

Related Questions