문제

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.

도움이 되었습니까?

해결책 2

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.

다른 팁

--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...

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top