Net-Appliance-Session - Re: How to send a carriage return?

Posted on Mon Jan 28 18:28:41 2008 by oliver in response to 6937 (See the whole thread of 5)
Re: How to send a carriage return?
Hi chicks1dig1unix,

Okay, there is a trick to this, and I think after your good question I'll make a note in the docs of the next release of the module.

If you have a command which needs a confirmation (e.g. reboot) or something which asks a supplementary question then you need to provide a one-off custom match prompt to cmd() to override the built in standard prompt. Here's a couple of examples:

$s->cmd( String => "copy tftp://1.2.3.4/configs/hostconfig startup-config", Match => ['/Destination filename/'], ); $s->cmd("\n"); $s->cmd( String => 'reload', Match => ['/Proceed with reload/'], ); $s->cmd( String => "\n", Match => ['//'], );

Hope that helps!

regards,
oliver.
Direct Responses: 6957 | Write a response