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

TCL script || yes/no

sebasttee
Level 1
Level 1

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?

 

1 Accepted Solution

Accepted Solutions

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

 

BB

***** Rate All Helpful Responses *****

How to Ask The Cisco Community for Help

View solution in original post

4 Replies 4

balaji.bandi
Hall of Fame
Hall of Fame

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 *****

How to Ask The Cisco Community for Help

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

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

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

 

BB

***** Rate All Helpful Responses *****

How to Ask The Cisco Community for Help