Syntax
cli_run clist
Arguments
(Mandatory) The list of commands to be executed.clist
Result String
Output of all the commands that are executed or an error message.
Set _cerrno
None.
Sample Usage
The following example shows how to use the cli_run command extension.
set clist [list {sh run} {sh ver} {sh event man pol reg}]
cli_run { clist }
cli_run_interactive
Provides a sublist to the clist which has three items. On success, returns the output of all executed commands
and on failure, returns error from the failure. Also uses arrays when possible as a way of making things easier
to read later by keeping expect and reply separated.
Syntax
cli_run_interactive clist
Arguments
(Mandatory) List of three items:
• command– Command to be executed
• expect– A regular expression pattern match for the expected reply
prompt
• responses– A list of possible responses to the reply prompt
constructed as an array of two items:
• expect– A regular expression pattern match for a possible reply
prompt
•
reply- A reply for that expected prompt
clist
Consolidated Platform Configuration Guide, Cisco IOS Release 15.2(4)E (Catalyst 2960-X Switches)
1855
cli_run_interactive