perl - Net::Telnet, trying to read a output -
I am trying to read this output from my output, how to use print and wait, I do not Successfully
This output is ....
zSH> V52-interface-group 1 v52-interface-group 1 Get the name-id: --------------------- & gt; {CTAA-024} Local-Interface-ID: ---------- & gt; {1024} Local-Pro-version: ---------- & gt; {2} prov-variant- Request: -------- & gt; {Norequest} Admin-Status: ---------------- & gt; {Inservice} pstn-layer-3-start-address: - & gt; {1} isdn-env-func-start-address: - & gt; {1} Port alignment-request: ------ & gt; {Norequest} National-PSTN-Area: -------- & gt; {Brazil} Switch-Vendor: --------------- & gt; {Nortel} Protocol-specific: --------------- & gt; {Edition2} startup check-link-id: ------- & gt; {False} startup-unblock-user-port: - & gt; {False} link-osus-timer: -------------- & gt; {2500} link-is-timer: --------------- & gt; {200} There are 16 elements in v52-link [A] ll, [n] one, display a [b], or [q] uit? Q This is a part of my code where I am trying to read ....
$ string = "display [a] ll , [N] one, a [s] ibsqt, or [q] ut? "; $ Tel- & gt; Print ("get v52-interface-group 1"); $ Tel- & gt; Waiting for (string = & gt; $ string); @out = $ tel- & gt; CMD ('q'); print out;
you waitfor () a Regex . $ string = "/ display \ s + \ [a \] ll, \ s + \ [n \] one, \ s + one \ s + \ [s \] ubset, \ S + or \ s + \ [q \] UIT \ / "; $ Tel- & gt; Waitfor ($ string);
Comments
Post a Comment