Linux Today: Linux News On Internet Time.





More on LinuxToday


6 Expect Script Examples to Expect the Unexpected (With Hello World)

Oct 14, 2010, 10:03 (0 Talkback[s])
(Other stories by Balakrishnan Mariyappan)

"Expect scripting language is used to feed input automatically to an interactive program. It is easy to learn compared to other scripting languages. Using expect script sysadmins and developers can automate redundant tasks easily. It works by expecting specific strings, and sending or responding strings accordingly.

"Following three expect commands are used when automating any interactive processes.

* send – to send the strings to the process
* expect – wait for the specific string from the process
* spawn – to start the command

"Make sure to install expect packages on your system, as it does not get installed by default. Once installed, you'll see the expect interpreter as "/usr/bin/expect". Generally, expect script files has .exp as extensions."

Complete Story

Related Stories: