Thanks for the help, but it didn't solve it. Some additional comments
bellow :
On Thu, 2005-08-18 at 13:13 -0700, David Gravereaux wrote:
> Frederic RISS wrote:
> > -------8<----- system.tcl --------8<----------
> > #!/bin/sh
> > # \
> > exec tclsh "$0" ${1+"$@"}
> >
> > package require Expect
> >
> > proc my_expect { expected } {
> global spawn_id
> > expect {
> > $expected { send_user "Got '$expected' output.\n" }
> > timeout { send_user "Timeout triggered for '$expected'.\n" }
> > }
> > }
> >
> > set timeout 3
> > spawn system.exe
> > my_expect "This is the beginning.\n"
> > send "y"
> > my_expect "Hello world!\n"
> > send "y"
> > my_expect "This is the end.\n"
> > -------8<-------------------------8<----------
>
>
> From what I remember, I think $spawn_id needs to have global scope in
> the proc.
I put that proc to get more feedback, but if you remove the proc and
replace my_expect by expect, you get the same error. Interestingly, I
discovered that if I try to not expect the 'Hello world' output, I don't
get the error on the following send. Unfortunately, this isn't an option
for my use case.
Any idea what's going on ?
Cheers,
Fred
_______________________________________________
Expect mailing list
Expect@list...
http://listserv.ActiveState.com/mailman/listinfo/expect
opensubscriber is not affiliated with the authors of this message nor responsible for its content.