EEM TCL Programming

Unanswered Question
Aug 19th, 2010
User Badges:

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?

  • 1
  • 2
  • 3
  • 4
  • 5
Overall Rating: 3.5 (2 ratings)
Loading.
Jason Fraioli Thu, 08/19/2010 - 12:27
User Badges:

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)#

yjdabear Thu, 08/19/2010 - 16:02
User Badges:
  • Gold, 750 points or more

puts -nonewline "enter your name: "

flush stdout

gets stdin Name

puts "Hello, $Name!"

Actions

This Discussion