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
|