---- '''Where can I learn about Expect's commands?''' [ActiveState] maintains online copies of documentation at [http://www.tcl.tk/man/expect5.31/index.html]. ---- '''Is Expect thread-safe?''' The answer, by [Don Libes] recently, was ''No''. [http://groups.google.com/groups?selm=s6a7m3f7me4.fsf@muffin.nist.gov] ---- '''Is there a newer version of Expect that works (and/or works better) for [Windows]?''' [Expect for Windows] There is an up-to-date port of Expect for Windows available from [ActiveState] commercially [http://www.activestate.com/Products/Expect/]. Otherwise there is an old port that is based off a hacked version of Tcl 8.0 from [Gordon Chaffee]. ---- '''Why does my script exit immediately without displaying results?''' This comes up often when people have scripts like below: ====== spawn ssh router send {show config} send {exit} ====== If you run this script, it will exit very quickly as though it does nothing. The reason should be obvious if you imagine the end of the script having an implicit [exit]: ====== spawn ssh router log_user 1 send {show config} send {exit} exit ====== The commands are getting sent to `ssh`'s [stdin], but since we never wait for a response there is no guarantee [ssh] got to read the characters, let alone the remote host! This is much like opening a terminal, typing some commands ''incredibly quickly'' and then immediately closing the terminal. You'd be incredibly lucky if this worked. Normally, the correct answer to this question is to insert after the last `send`: ====== expect eof ====== ---- [how to access the result of a remote command in Expect]. [How Expect sees function keys] One frequently-asked question is [how to send escape characters through Expect]. <> Expect