Re: Expect: timeout actions within expect_background commands--why don't they run?

robroy_at_armory.com
Date: 01/27/05


Date: 27 Jan 2005 09:44:31 -0800

Don, thanks very much for your reply.

Given that this has been a limitation in the implementation up until
now, do any possible workarounds come to mind? I'm just curious, as
I'd love to be able to use timeouts in background patterns. If nothing
comes to mind, that's okay--expect is still an amazing tool by any
measure.

I really appreciate your time,
-Robroy

Robroy Gregg
robroy@armory.com
Santa Cruz, CA USA

Don Libes wrote:
> I believe that's a limitation in the current implementation. I'll
add
> a note to the documentation.
>
> Don
>
> "robroy@armory.com" <robroy@armory.com> writes:
>
> > Hello Expect experts,
> >
> > Why do timeout actions within expect_background commands not run?
For
> > example, consider this code:
> >
> > #!/bin/sh
> > #
> > # Restart with Expect \
> > exec expect $0 $@
> >
> >
#--------------------------------------------------------------------
> > # This script illustrates a background pattern with a defined
timeout
> > # action. Why does the timeout action never execute?
> >
#--------------------------------------------------------------------
> >
> > expect_background -timeout 1 timeout {
> > set ::timeoutEvent 0
> > }
> > vwait ::timeoutEvent
> > puts "I never get to this line. Why not?"
> >
> > What method may I use to enjoy a functioning timeout facility from
> > within expect_background commands?
> >
> > Thank you!
> > -Robroy
> >
> > Robroy Gregg
> > robroy@armory.com
> > Santa Cruz, California, USA


Loading