cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1348
Views
0
Helpful
1
Replies

Parse Running Config with TcL

Cory Anderson
Level 1
Level 1

Hi All,

I've written a script to parse our configs against company policy using TcL.  I'm setting a variable as the output of "show run".

 

set run [exec "show run"]

 

The problem is sometimes my $run variable isn't the config, but says something like "building the configuration".  Is there a way of either making TcL wait for the configuration to be built, or to open it as a variable from flash to parse?

 

Thanks,

Cory Anderson

1 Reply 1

Joe Clarke
Cisco Employee
Cisco Employee

Honestly, I am pushing people away from using tclsh for anything more than a few lines.  Instead, using EEM Tcl provides better access control, better libraries, better debugging, and more reliability.

 

If you convert your script to EEM Tcl, you will have much better luck getting the full output of CLI commands.