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

EEM TCL Programming

Is it possible to program a question and response logic into TCL scripts?  I'd like to be able to capture user input and take action based on that input.  Is that possible?  If so, could you please point me to a resource where I can learn more about it?

4 REPLIES
Silver

Re: EEM TCL Programming

New Member

Re: EEM TCL Programming

thanks for the link, but the documentation on a particular function is a bit lacking.  I am trying to capture STDIN, but not having much luck.  As you can see from the output below, TCL doesn't like the fact that I typed "MyName" then hit the enter key.  I'm not sure why and I can't find any documentation on how to read STDIN like this.

Switch(tcl)#set name [typeahead "enter your name: "]

Switch(tcl)#enter your name: MyName

invalid command name "enter"              ^
% Invalid input detected at '^' marker.

Switch(tcl)#

Silver

Re: EEM TCL Programming

Blue

Re: EEM TCL Programming

puts -nonewline "enter your name: "

flush stdout

gets stdin Name

puts "Hello, $Name!"

500
Views
7
Helpful
4
Replies
CreatePlease to create content