Dynamic prompts
Two prompt variables can be used to store the device command prompt, and then later use it for purposes such as a deliminator when extracting device responses. They are $prompt1$ and $prompt2$, and are accessed by getPromptN and setPromptN commands.
Commands
First you initialize the prompt
variable, for example:
config.running.00.getPrompt1=\r
The
argument to getPrompt1
is a string to send the device
that will result in the device returning the content destined for
the prompt variable. Once initialized, it may be used elsewhere, as
illustrated in this example:config.running.00.getPrompt1=\r
config.running.01.send=show running-config\r
config.running.end=$prompt1$
config.running.FIND-BEGIN=Running
config.running.FIND-END=$prompt1$
config.running.01.send=config t\r
config.running.03.wait=)#
config.running.04.getPrompt1=\r
config.running.05.send=show running-config\r
config.running.08.sleep=6000
config.running.end=$prompt1$
config.running.FIND-BEGIN=configure
config.running.FIND-END=$prompt1$
The device scripts
in this example determine the device prompt by sending it a carriage
return, and then uses it to determine the end of config.running
execution,
as well as the end of the text to extract that represents the device
configuration.