Expect Script Error invalid spawn id (6)

Hi everybody,

We are trying to connect to a server and to a router using an .expect script that automatically authenticate the username and password needed. The error is that we cannot connect to the server using ssh AND we cannot connect to the router using either telnet or go commands from the .expect script.

However, when trying the same commands from the Unix shell the both connections to the server and router are established without problem.

Here is the error message we received:
expect: invalid spawn id (6)

thanks a lot

Can you post some of your expect code?

From Exploring Expect:
When a spawn command is executed, the variable spawn_id is set to an
identifier that refers to the process. The spawn_id variable is examined each time send
and expect are called. send and expect know how to access the process by using the
value in spawn_id.