Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Other solutions/languages that are superior to the TCL-based Expect? [closed]

I am amazed by how Expect (TCL) can automate a lot of things I normally could not do.

I thought I could dig deeper into Expect by reading a book, but before I do that I want to ask if there are other solutions/languages that could do what Expect does?

Eg. I have read that people compare Expect with Awk and also Perl.

Could Awk and Perl do the same thing?

How about other languages like Python and Ruby?

Is Expect the de-facto automation tool or are there other solutions/languages that are more superior?

like image 598
never_had_a_name Avatar asked Sep 19 '10 15:09

never_had_a_name


2 Answers

There's more to it.

Bluntly, the original Expect--the Tcl Expect--is the best one. It better supports "interact" and various pty eccentricities than any of its successors. It has no superior, for what it does.

HOWEVER, at the same time, most Expect users exploit such a small fraction of Expect's capabilities that this technical superiority is a matter of indifference to them. In nearly all cases, I advise someone coming from Perl to use Expect.pm, someone familiar with Python to rely on Pexpect, and so on.

Naive comparisons of Perl with "... Awk and also Perl" are ill-founded.

In the abstract, all the common scripting languages--Lua, awk, sh, Tcl, Ruby, Perl, Python, ...--are about the same. Expect slightly but very effectively extends this common core in the direction of pty-awareness (there's a little more to the story that we can neglect for the moment). Roughly speaking, if your automation involves entering an invisible password, you want Expect. Awk and Perl do NOT build in this capability.

There are other automation tools for other contexts.

like image 71
Cameron Laird Avatar answered Oct 20 '22 00:10

Cameron Laird


Check out Expect for Perl

like image 21
user449592 Avatar answered Oct 20 '22 01:10

user449592