Expect Scripts Install on Windows and tips

Here is a tips for how to install Expect Script on Windows system.(32bit)

 

1. Downlaod Expect Script for Windows from here(Community version : Free)

There are three different versions

– 8.4: This version includes the Expect Script Version 5.43

– 8.5: This version NOT includes any, but extra install step( c:\tcl\bin\teacup install Expect )

– 8.6: This version NOT includes any, but extra install step( c:\tcl\bin\teacup install Expect )

 

* On a Windows 64bit system, it won’t install any, b/c 64bit Expect Script is not available from the server.

Resolving Expect … Not found in the archives.

 

C:\tcl\bin\teacup search "Expect"

Only win32-ix86.exe from package list, but NO 64bit.

 

 

 2. On the Expect Script file

 

#!/bin/sh
# \
exec tclsh "$0"  ${1+"$@"}

# This is required to declare that we will use Expect
package require Expect

— put your script —

 

 

 

3. To verify Expect commands

c:\tcl\bin\tclsh or tclsh84

% package require Expect

% spawn

 

4. Path

Set path=c:\Tcl\bin

 

5. File extention

*.tcl

 

6. Path

c:> Tclsh example.tcl

 

7. Error message – invalid command name "spawn"

If you get the above message, then either you didn’t put "package require Expect" on your script file with ActiveState version 8.4 package or using ActiveState version 8.5/8.6 which is not support 64bit.

 

 

 

Leave a Reply