<s>
Expect	O
is	O
an	O
extension	O
to	O
the	O
Tcl	B-Operating_System
scripting	B-Language
language	I-Language
written	O
by	O
Don	O
Libes	O
.	O
</s>
<s>
Expect	O
,	O
originally	O
written	O
in	O
1990	O
for	O
the	O
Unix	B-Application
platform	O
,	O
has	O
since	O
become	O
available	O
for	O
Microsoft	B-Application
Windows	I-Application
and	O
other	O
systems	O
.	O
</s>
<s>
Expect	O
is	O
used	O
to	O
automate	O
control	O
of	O
interactive	O
applications	B-Application
such	O
as	O
Telnet	B-Protocol
,	O
FTP	B-Protocol
,	O
passwd	B-Protocol
,	O
fsck	B-Device
,	O
rlogin	B-Application
,	O
tip	B-Protocol
,	O
SSH	B-Protocol
,	O
and	O
others	O
.	O
</s>
<s>
Expect	O
uses	O
pseudo	B-Protocol
terminals	I-Protocol
(	O
Unix	B-Application
)	O
or	O
emulates	O
a	O
console	O
(	O
Windows	B-Application
)	O
,	O
starts	O
the	O
target	O
program	O
,	O
and	O
then	O
communicates	O
with	O
it	O
,	O
just	O
as	O
a	O
human	O
would	O
,	O
via	O
the	O
terminal	O
or	O
console	O
interface	O
.	O
</s>
<s>
Tk	B-Application
,	O
another	O
Tcl	B-Operating_System
extension	O
,	O
can	O
be	O
used	O
to	O
provide	O
a	O
GUI	B-Application
.	O
</s>
<s>
They	O
were	O
built	O
to	O
service	O
the	O
users	O
administering	O
the	O
product	O
,	O
but	O
the	O
company	O
often	O
does	O
not	O
spend	O
the	O
resources	O
to	O
fully	O
implement	O
a	O
robust	O
scripting	B-Language
language	I-Language
.	O
</s>
<s>
An	O
Expect	O
script	B-Language
can	O
spawn	O
a	O
shell	B-Language
,	O
look	O
up	O
environmental	O
variables	O
,	O
perform	O
some	O
Unix	B-Application
commands	O
to	O
retrieve	O
more	O
information	O
,	O
and	O
then	O
enter	O
into	O
the	O
product	O
's	O
command-line	O
interface	O
armed	O
with	O
the	O
necessary	O
information	O
to	O
achieve	O
the	O
user	O
's	O
goal	O
.	O
</s>
<s>
After	O
retrieving	O
information	O
by	O
interacting	O
with	O
the	O
product	O
via	O
its	O
command-line	O
interface	O
,	O
the	O
script	B-Language
can	O
make	O
intelligent	O
decisions	O
about	O
what	O
action	O
to	O
take	O
,	O
if	O
any	O
.	O
</s>
<s>
This	O
allows	O
the	O
script	B-Language
to	O
harvest	O
information	O
to	O
feedback	O
to	O
the	O
user	O
,	O
and	O
it	O
also	O
allows	O
conditional	O
behavior	O
of	O
what	O
to	O
send	O
next	O
based	O
on	O
the	O
circumstances	O
.	O
</s>
<s>
DejaGnu	B-Library
is	O
a	O
testing	O
suite	O
written	O
using	O
Expect	O
for	O
use	O
in	O
testing	O
.	O
</s>
<s>
It	O
has	O
been	O
used	O
for	O
testing	O
GCC	B-Application
and	O
remote	O
targets	O
such	O
as	O
embedded	O
development	O
.	O
</s>
<s>
Expect	O
script	B-Language
can	O
be	O
automated	O
using	O
a	O
tool	O
called	O
'	O
autoexpect	O
 '	O
.	O
</s>
<s>
This	O
tool	O
observes	O
your	O
actions	O
and	O
generates	O
an	O
Expect	O
script	B-Language
using	O
heuristics	O
.	O
</s>
<s>
Though	O
generated	O
code	O
may	O
be	O
large	O
and	O
somewhat	O
cryptic	O
,	O
one	O
can	O
always	O
tweak	O
the	O
generated	O
script	B-Language
to	O
get	O
the	O
exact	O
code	O
.	O
</s>
<s>
Another	O
example	O
is	O
a	O
script	B-Language
that	O
automates	O
FTP	B-Protocol
:	O
</s>
<s>
Using	O
passwords	O
as	O
command-line	O
arguments	O
,	O
like	O
in	O
this	O
example	O
,	O
is	O
a	O
huge	O
security	O
hole	O
,	O
as	O
any	O
other	O
user	O
on	O
the	O
machine	O
can	O
read	O
this	O
password	O
by	O
running	O
"	O
ps	B-Application
"	O
.	O
</s>
<s>
Another	O
example	O
of	O
automated	O
SSH	B-Protocol
login	O
to	O
a	O
user	O
machine	O
:	O
</s>
<s>
Various	O
projects	O
implement	O
Expect-like	O
functionality	O
in	O
other	O
languages	O
,	O
such	O
as	O
C#	B-Application
,	O
Java	B-Language
,	O
Scala	B-Application
,	O
Groovy	B-Application
,	O
Perl	B-Language
,	O
Python	B-Language
,	O
Ruby	B-Language
,	O
Shell	B-Language
and	O
Go	B-Application
.	O
</s>
<s>
-	O
an	O
Expect-like	O
Go	B-Application
language	I-Application
library	O
to	O
automate	O
control	O
of	O
terminal	O
or	O
console	O
based	O
programs	O
.	O
</s>
<s>
-	O
a	O
Groovy	B-Application
DSL	O
implementation	O
of	O
Expect	O
tool	O
.	O
</s>
<s>
—	O
a	O
pure	O
Java	B-Language
1.6	O
+	O
implementation	O
of	O
the	O
Expect	O
tool	O
.	O
</s>
<s>
-	O
a	O
Java	B-Language
implementation	O
of	O
the	O
Expect	O
tool	O
,	O
but	O
supports	O
nested	O
closures	O
.	O
</s>
<s>
There	O
is	O
also	O
wrapper	O
for	O
Groovy	B-Application
language	I-Application
DSL	O
.	O
</s>
<s>
—	O
A	O
Python	B-Language
expect-like	O
extension	O
for	O
the	O
Paramiko	O
SSH	B-Protocol
library	O
which	O
also	O
supports	O
tailing	O
logs	O
.	O
</s>
<s>
—	O
a	O
Scala	B-Application
implementation	O
of	O
a	O
very	O
small	O
subset	O
of	O
the	O
Expect	O
tool	O
.	O
</s>
<s>
It	O
's	O
implemented	O
in	O
the	O
client/server	O
model	O
which	O
also	O
supports	O
attach/detach	O
(	O
like	O
GNU	B-Application
screen	I-Application
)	O
.	O
</s>
