Current Issue


Table of contents

CD-ROM

Sys Admin and The Perl Journal CD-ROM version 12.0

Version 12.0 delivers every issue of Sys Admin from 1992 through 2006 and every
issue of The Perl Journal from 1996-2002 in one convenient CD-ROM!

Order now!

Sys Admin Magazine > Archives > 2002 > July

Expect: The Firefighter’s Friend

Cameron Laird

Most UNIX administrators are familiar with the Expect utility. They generally know it as a way to automate password entry in FTP clients or password-management system commands.

As crucial as its use can be in these applications, Expect has many other capabilities that may be less well known. Moreover, Expect is available for Windows. This article briefly surveys the range of Expect uses, then concentrates on ways Expect solves one-time emergencies. One major role that systems administrators play is to repair the damage — missing files, lost passwords, and so on — that arises in day-to-day information technology (IT) operation. These operations don’t have to be as tedious as they seem. In many cases, Expect can turn hours of drudgery into a short scripting session.

Tcl/Tk Plus More

The first essential to understand about Expect is that it’s a full-blown, general-purpose programming language. Yes, it’s a handy tool for automation of password management, but that’s only a showy side effect of its more general capabilities.

Expect is an “extension” of the Tcl/Tk high-level language. That means it does everything Tcl/Tk does, and knows a few commands more, in the broad categories of:

  • Debugging
  • Character-oriented dialogue management
  • Pseudoterminal management

Pseudoterminals take responsibility for “funny” character handling, as with password entry made invisible by manipulating terminal characteristics. “Dialogue management” has to do with pattern matching the “conversation” between a user and an application: the user types something, the program responds, the user types again, and so on. Expect defines a convenient language for making calculations based on such dialogues.




MarketPlace

Free Download Speeds Up PCs
Make Your PC Faster --New Diskeeper 2008 Speeds Up PCs --Download Free Trial Now!

Automate Software Builds with Visual Build Pro
Easily create an automated, repeatable process for building and deploying software.

Flowcharts from C/C++ code -- Free trial download
Understand C/C++ code in less time. A new team member ? Inherited legacy code ? Get up to speed faster with Crystal Flow for C/C++. Code-formatting improves readability. Flowcharts are integrated with code browser. Export flowcharts to Visio.

WinDev 12 - Powerful IDE
Develop 10 times faster ! ALM, IDE, .Net, RAD, 5GL, Database, 5GL, 64-bit, etc. Free Express version

Wanna see your ad here?