dutchlab
dutchlab

Reputation: 590

Send ctrl + z to Cisco device

I have a need to send CTRL + Z to a Cisco device via TCL and Expect Scripting in order to get a prompt so that the scripting can perform an operation on the device. An example would be that if the script finds the state to be:

--MORE--

If you are sitting at the console you can send CTRL+Z and you will get:

#:

How can I do this from an automated script. I have tried:

send "\u001A";

and

send "\x1A";

They seem to be ignored.

Upvotes: 0

Views: 2349

Answers (2)

James
James

Reputation: 1236

You should be able to find exactly what octal value your CTRL+Z has by using od (octal dump), and then sticking that in your script.

See a good explanation on how to determine that here:

http://expect.sourceforge.net/FAQ.html#q54

Other than that, I have to say that Vidiyal's suggestion (trying with Q instead of CTRL+Z) has merit, and is a lot simpler.

Upvotes: -1

Downey_HUff
Downey_HUff

Reputation: 189

--MORE-- in the cisco ios can also be get rid and return to the device prompt , if you send "q" try it out manually on device and just send "q" to return to prompt..Hope it solves issue...

Upvotes: -1

Related Questions