Version 22 of Many people who think they need Expect do not need Expect

Updated 2012-06-25 06:59:53 by RLE

[ Expect is wonderful. Its role in the past was quite large.]

Primarily, Expect makes it possible to write programs that control other programs designed to be used interactively by a human.

[Now there are often strictly superior approaches for many problems that would have been solved in the past with Expect.]

LV I find the word often , in the sentence above, to be perhaps a bit more optimistically enthusiastic than I myself see the situation...

So the title can be expanded: Many people who know they need Expect...do not need Expect.

One reason for this is that where there once was only one program that could do X, and it has an interactive interface, there is now more often a second program for doing X that other programs/shell scripts can call. [Examples, anyone?]

LV If you don't have examples, then could it be that this isn't a general case?

[On another hand, Expect still has many uses that programmers do not know.]


So, here are examples of more modern ways to do things that once would have been best with Expect:


"Others have given you answers to your immediate problem. I would suggest you look at cfengine as a longer term solution. The problem you described could have been trivially solved by adding a few lines to the cfengine master files at the policy server. On the next scheduled run, all the servers would have downloaded the new config file, seen the new instructions and implemented them." [Rework, explain what relevance cfengine has to tcl, expect, etc ...]


This page doesn't yet explain anything; it only alludes to ideas that those who already understand will recognize. Also, it should be noted that, while Expect isn't the preferred way in 2007 to automate FTP (for example), there are rare circumstances in which an expert might choose to use it.


Expect is still useful even with the above mentioned programs. If you want to automate the tasks these programs perform then Expect is still needed here.