Training, Open Source computer languages
PerlPHPPythonMySQLApache / TomcatTclRubyJavaC and C++LinuxCSS 
Search for:
Home Accessibility Courses Diary The Mouth Forum Resources Site Map About Us Contact
For 2021 - online Python 3 training - see ((here)).

Our plans were to retire in summer 2020 and see the world, but Coronavirus has lead us into a lot of lockdown programming in Python 3 and PHP 7.
We can now offer tailored online training - small groups, real tutors - works really well for groups of 4 to 14 delegates. Anywhere in the world; course language English.

Please ask about private 'maintenance' training for Python 2, Tcl, Perl, PHP, Lua, etc.
Help ASAP: is TCL mendatory for Expect?

Posted by Panthini (Panthini), 28 September 2005
Hi all,
I am new to Expect.
I have few questions:
1) Is it mendatory to use tcl or any other shell script with expect? if yes, Why do we need that?
2) what is difference between tcl and bash? Can I use expect with bash?
3) I tried writing basic script thats does ssh to remote machine using send and expect.
How do I write if-else or for loop usinf expect..where can I find the syntax.
I dont have book "exploring Expect", Please let me know if there are other good resources for beginners.

Thanks in advance.

Posted by admin (Graham Ellis), 28 September 2005
Dear Panthini,

I try to see and answer all posts as soon as I can, so there's no need to include "ASAP" in the subject line.  

The best reference material for Expect is, indeed, the "Exploring Expect" book and I suggest that you get hold of a copy if you don't have one.  As you learn your way into Expect, you'll find that the book becomes progressively more useful to you.

Your other questions are very wide ranging, and I take it that you need to get up to speed very rapidly;  Tcl WILL be a necessity as Expect sits on top of it ... and to learn it quickly I''m going to suggest that you have a look at training courses as the tutor will be able to take you though each of the steps in turn, within just a couple of days.  The course I've linked to just above DOES include Expect; that won't apply to every Tcl course you find.

Specific answers

1. Yes - you need Tcl; Expect is an extension to Tcl and you can't extend something you don't have.

2. Expect is an extension to the Tool Control Language - a programming language.  Bash is a shell - a command line interpretter that's extended into becoming something of a programming language.  You can run Expect within Bash provided that you also have Tcl in between.

3. To answer this quiestion, I would be putting a complete training course on line and a forum is not a good medium for this. Just not practical to learn a complete language efficiently through a series of questions and answers.   However, there are examples and resources on our web site - specific examples and articles on loops and conditionals and Tcl may be found on our site.

Posted by Panthini (Panthini), 28 September 2005
Thanks a lot.
Your answer has made many things cleared.

Please update me when you put the training course online as you said in 3rd point.


Posted by admin (Graham Ellis), 28 September 2005
All the examples in the training course are online already, so that trainees who have attended the courses and people who just need to see examples of specific are catered for.   We've considered (and rejected) online training in the past; our notes and style are best suited for a more "classic" training environment, and we would be speading ourselves too thinly to try and do an online product as well.

This page is a thread posted to the opentalk forum at and archived here for reference. To jump to the archive index please follow this link.

You can Add a comment or ranking to this page

© WELL HOUSE CONSULTANTS LTD., 2022: Well House Manor • 48 Spa Road • Melksham, Wiltshire • United Kingdom • SN12 7NY
PH: 01144 1225 708225 • FAX: 01144 1225 793803 • EMAIL: • WEB: • SKYPE: wellho