ActiveState Community

first lines of TCL script for Windows

Posted by exquisitenick on 2009-06-20 04:44

Hello,
I am trying to write an Expect script but I do not know the first lines that are needed in the TCL script.
I tried the following script but it fails in the
'package require Expect'.
What are the correct first lines for Windows?
Thank you.

My script:

#!"c:\Program Files\tcl\bin\wish85.exe"
# \
exec tclsh "$0" ${1+"$@"}
package require Expect

spawn telnet 192.168.1.52

expect "y/n"
send "\r"

expect "login:"
send "user\r"

expect "password:"
send "user\r"

jeffh | Mon, 2009-06-22 16:15

If the package require statement fails, it is likely telling you that the package is not installed. Use ActiveTcl's teacup to acquire it with [teacup install Expect].

exquisitenick | Tue, 2009-06-23 01:39

Thank you very much. It worked!