prints an error and exits if the version is out of date
a required version of Expect.
The exp_version command is
useful for assuring that the script is compatible with the current version
With no arguments, the current
version of Expect is returned. This version may then be encoded in
your script. If you actually know that you are not using features
of recent versions, you can specify an earlier version.
Versions consist of three
numbers separated by dots. First is the major number. Scripts
written for versions of Expect with a different major number will almost
certainly not work. exp_version returns an error if the major numbers
do not match.
Second is the minor number.
Scripts written for a version with a greater minor number than the current
version may depend upon some new feature and might not run. exp_version
returns an error if the major numbers match, but the script minor number
is greater than that of the running Expect.
Third is a number that plays
no part in the version comparison. However, it is incremented when
the Expect software distribution is changed in any way, such as by additional
documentation or optimization. It is reset to 0 upon each new minor
With the -exit flag, Expect
prints an error and exits if the version is out of date.
This material is excerpted
from the O'Reilly book "Exploring Expect" by Don Libes, and can also be
found in the manpage on many UNIX platforms.