public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* expect does not timeout
@ 1999-09-08  6:58 Lasslop, Andre
  1999-09-30 23:42 ` Lasslop, Andre
  0 siblings, 1 reply; 4+ messages in thread
From: Lasslop, Andre @ 1999-09-08  6:58 UTC (permalink / raw)
  To: cygwin

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1433 bytes --]

Hi all,

I got a problem with a simple expect-script for controlling a serial I/O
driver with a command line interface via readline.
The part of the command script which makes the problem is the following :

    	set timeout 1
	expect {
		-i $RS_ID
		-re " ff .. 60" {
		    exp_send_user "Message 1.\n"
		    exp_continue
		} -re "^T> " {
		    exp_send_user "Unknown Msg.\n"
		    exp_continue
		} timeout {
		} eof {
		}
	}

The driver ($RS_ID) has spawned and receives some messages which were
printed to stdout as hex-dump. Expect detects the Messages and prints the
corresponding name to the user. If no more messages arrive, the script
should detect a timeout (after 1 second for this example) and go away. But
after the correct message detection does the script hang and do not detect
the timeout. I tried the following construct :

    	set timeout 1
	expect {
		-i $RS_ID
		timeout
		-re " ff .. 60" {
		    exp_send_user "Message 1.\n"
		    exp_continue
		} -re "^T> " {
		    exp_send_user "Unknown Msg.\n"
		    exp_continue
		}
	}

This detects the timeout but leads to an error cause the "-re ..." construct
is interpreted as the command.
If I include "timeout {}" instead the script does stop as before.

I'm using cygwin b20.1. The expect version is 5.26. Tcl is 8.0p2.

Any suggestions ? 

Thanks

André Lasslop

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com

^ permalink raw reply	[flat|nested] 4+ messages in thread

* expect does not timeout
  1999-09-08  6:58 expect does not timeout Lasslop, Andre
@ 1999-09-30 23:42 ` Lasslop, Andre
  0 siblings, 0 replies; 4+ messages in thread
From: Lasslop, Andre @ 1999-09-30 23:42 UTC (permalink / raw)
  To: cygwin

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1433 bytes --]

Hi all,

I got a problem with a simple expect-script for controlling a serial I/O
driver with a command line interface via readline.
The part of the command script which makes the problem is the following :

    	set timeout 1
	expect {
		-i $RS_ID
		-re " ff .. 60" {
		    exp_send_user "Message 1.\n"
		    exp_continue
		} -re "^T> " {
		    exp_send_user "Unknown Msg.\n"
		    exp_continue
		} timeout {
		} eof {
		}
	}

The driver ($RS_ID) has spawned and receives some messages which were
printed to stdout as hex-dump. Expect detects the Messages and prints the
corresponding name to the user. If no more messages arrive, the script
should detect a timeout (after 1 second for this example) and go away. But
after the correct message detection does the script hang and do not detect
the timeout. I tried the following construct :

    	set timeout 1
	expect {
		-i $RS_ID
		timeout
		-re " ff .. 60" {
		    exp_send_user "Message 1.\n"
		    exp_continue
		} -re "^T> " {
		    exp_send_user "Unknown Msg.\n"
		    exp_continue
		}
	}

This detects the timeout but leads to an error cause the "-re ..." construct
is interpreted as the command.
If I include "timeout {}" instead the script does stop as before.

I'm using cygwin b20.1. The expect version is 5.26. Tcl is 8.0p2.

Any suggestions ? 

Thanks

André Lasslop

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: expect does not timeout
  1999-09-08  9:09 DJ Delorie
@ 1999-09-30 23:42 ` DJ Delorie
  0 siblings, 0 replies; 4+ messages in thread
From: DJ Delorie @ 1999-09-30 23:42 UTC (permalink / raw)
  To: cygwin

In expect/expect.c, add something like this:

#ifdef __CYGWIN32__
#define SIMPLE_EVENT
#endif

The reason is that expect is using cygwin's features (and expecting
tcl to also do so), but tcl knows it's running under windows (so that
tk works right) and uses different features.

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: expect does not timeout
@ 1999-09-08  9:09 DJ Delorie
  1999-09-30 23:42 ` DJ Delorie
  0 siblings, 1 reply; 4+ messages in thread
From: DJ Delorie @ 1999-09-08  9:09 UTC (permalink / raw)
  To: cygwin

In expect/expect.c, add something like this:

#ifdef __CYGWIN32__
#define SIMPLE_EVENT
#endif

The reason is that expect is using cygwin's features (and expecting
tcl to also do so), but tcl knows it's running under windows (so that
tk works right) and uses different features.

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~1999-09-30 23:42 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-09-08  6:58 expect does not timeout Lasslop, Andre
1999-09-30 23:42 ` Lasslop, Andre
1999-09-08  9:09 DJ Delorie
1999-09-30 23:42 ` DJ Delorie

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).