Cisco Support Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Announcements

Welcome to Cisco Support Community. We would love to have your feedback.

For an introduction to the new site, click here. And see here for current known issues.

New Member

tclsh script not working like I want it to...

Using this script, when I execute it, it stops at Erasing VLAN Database and sits there until I hit enter again, then it finishes the script and reloads the device. Thoughts on why?

tclsh

puts [open "flash:reset.tcl" w+] {

puts "Erasing Configuration"

typeahead "\r"

puts [ exec "write erase" ]

puts "Erasing VLAN Database"

typeahead "\r"

puts [ exec "del flash:vlan.dat" ]

puts "Copying Base Configuration To Startup"

typeahead "\r"

puts [ exec "copy flash:baseline.cfg nvram:startup-config" ]

puts "Reloading The Device"

typeahead "\r"

puts [ exec "reload" ]

}

1 REPLY
New Member

tclsh script not working like I want it to...

Did you tried adding another carriage return?

typeahead "\r\r"

I tested your original script in a switch and it worked.

134
Views
0
Helpful
1
Replies
CreatePlease login to create content