I'm trying to build a small expect script to reboot my Cisco VCS devices. However once logging into the device it doesn't have any prompting characters so I'm unsure how to initialise a send request
Example Prompt:
So far I tried
expect "OK/r"
send "command"
expect "OK/r/r"
send "command"
experimented with timeout but unsure how it works.
I also tried the autoexpect tool and it showed a weird character [?1034h"
at the prompt which I tried including.
Any help would be appreciated
I would think you should be able to expect the OK plus one or both of newline or carriage return. But you need backslashes for that, not forward ones. I would try "OK\r" or "OK\r\n".
Here's what you need to do: include
expect_internal 1
somewhere near the top of your script, then run it again. Expect will give you a ton of information on what it is and it is not matching. That should show you what it's receiving, and you will be able to craft your expect statement accordingly.If you're unsure, edit your question to include the debugging output and I will try to help.