Header
Home | Set as homepage | Add to favorites
  Search the Site     » Advanced Search
Sections
Syndication


Blogroll:

||||| ALL Cisco-Network ARTICLES |||||  
CCIE Journey,
The CCIE Journey,


Expect

Jul 21,2008 by admin

image

Expect

Expect is another scripting language that helps solve a different type of problem. Where Perl's strength is in pattern matching, Expect provides a way to automate interactive applications. We usually use Expect to imitate user sessions on a router to automate command-line-based tasks.

The Expect program is able to send one or more lines of output, such as router commands, and capture the results. And it can also react to whatever the router sends it in return. This could be as simple as sending a user ID and waiting for the password prompt, or you could use this feature to check for various error conditions and react appropriately.

We often write scripts in Expect to automate boring repetitive tasks. Computers are good at these tasks, people aren't. People make typos and get bored or blink and miss key pieces of information. Also, because Expect can react immediately to the router's responses, the script can generally execute a series of commands very quickly. We think it's better to spend your time doing something productive while the computer is logging into all of your routers to do show commands. Expect lets us do this.

Expect is free to download, distribute, and use for any purpose. There are both Unix and Windows versions, and there are even companies doing commercial support for Expect. We wrote and tested all of the scripts in this book using Expect Version 5.31.2 on a Unix platform.


215 times read

Related news

» Automating the Login Sequence
by admin posted on Jul 21,2008
» Changing the Configurations of Many Routers at Once
by admin posted on Jul 21,2008
» Perl
by admin posted on Jul 21,2008
» Connectionless Transport
by alperen posted on Dec 20,2008
» Changing TCP Ports for FTP
by admin posted on Jul 21,2008
Did you enjoy this article?
(total 0 votes)

comment Comments (0 posted) 

More Top News
CCSP-Cisco Certified Security Professional
Most Popular
Most Commented
Featured Author