4 ms·
For me, the best feature of Tcl is actually not part of the language itself. It's a tool built on top of Tcl -- Expect. Expect can be used to automate CLI task
by geoka9 14y ago
For me, the best feature of Tcl is actually not part of the language itself. It's a tool built on top of Tcl -- Expect.
Expect can be used to automate CLI tasks, but for me it is indispensable for testing programs with text-only UIs (I get to write a lot of those).
http://www.nist.gov/el/msid/expect.cfm http://www.nist.gov/el/msid/expect.cfm
- zaroth 14y agoAh, TCL, I knew thee well. Back in the 8.3 days, when expect was still a commercial add-on form ActiveState for TCL on Windows, I implemented my own Expect command in TCL based on 'socket'. If you ever find yourself using Expect with telnet, if you need more performance, you can implement your own Expect using socket which will run at least 10x faster. The only trick is sending the right TELNET opcodes to get your target device to actually respond with a prompt!
- iso-8859-1 14y agothere's a python replacement: http://pexpect.sourceforge.net/pexpect.html http://pexpect.sourceforge.net/pexpect.html
- draegtun 14y agoYou can also find Expect ports in other languages. For e.g.: * Perl - https://metacpan.org/release/Expect https://metacpan.org/release/Expect * Ruby - http://rubygems.org/gems/expectr http://rubygems.org/gems/expectr