in reply to Disabling a port using Net::telnet:Cisco
assuming the confirmation line comes immediately after the command try sending the 'y' with the command separated by a newline.
$cmd = 'disable port p1/1/0\ny';
i think i've gotten this to work before, but i might have been using Expect.
alternatively i think you can set the prompt string to match the question.
# pseudocode $realprompt = 'rtrname#'; $quesprompt = '[y/n]?'; $conn->prompt($quesprompt); $conn->cmd('disable port p1/1/1'); # and wait for quesprompt $conn->prompt($realprompt); # reset prompt $conn->cmd('y'); # and wait for realprompt
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Disabling a port using Net::telnet:Cisco
by chimni (Pilgrim) on Jul 28, 2003 at 10:13 UTC |