cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
125
Views
0
Helpful
4
Replies
Beginner

TCL script || yes/no

Hi,

 

I need some help to do a script to accept "Yes" from CLI

I want to do TCL Script to put this command: vrf upgrade-cli multi-af-mode common-policies vrf XXX

 

If i insert this command on CLI, it´ll give me:

 

ROUTER(config)#vrf upgrade-cli multi-af-mode common-policies vrf NAC
You are about to upgrade to the multi-AF VRF syntax commands.
You will lose any IPv6 addresses configured on interfaces
belonging to upgraded VRFs.

Are you sure ? [yes]:

 

My script will be something like this:

 

tclsh
ios_config "vrf upgrade-cli multi-af-mode common-policies vrf XXX"

...

but then i don´t know to accept the "yes".

 

Can someone give a suggest?

 

Everyone's tags (2)
4 REPLIES 4
Highlighted
VIP Advocate

Re: TCL script || yes/no

Look at this thread, you need to use regex to parse the output and take action based on output.

 

https://community.cisco.com/t5/network-management/tcl-cli-read-pattern/td-p/2261228

 

BB
*** Rate All Helpful Responses ***
Beginner

Re: TCL script || yes/no

I have already looked to that thread. I'm not familiarize with this type of language. I was look for something easier.

Beginner

Re: TCL script || yes/no

I have found a solution.

 

tclsh
foreach VRF {
aaa
bbb
} { puts "[ ios_config "vrf upgrade-cli multi-af-mode common-policies vrf $VRF" ]" }
yes
yes
tclquit

VIP Advocate

Re: TCL script || yes/no

good to know it was solved, the document have that command syntax.

 

BB
*** Rate All Helpful Responses ***
CreatePlease to create content
ask the Expert- Cisco's Branch Routing Portfolio