From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Lasslop, Andre" To: cygwin@sourceware.cygnus.com Subject: expect does not timeout Date: Wed, 08 Sep 1999 06:58:00 -0000 Message-id: X-SW-Source: 1999-09/msg00099.html 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 From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Lasslop, Andre" To: cygwin@sourceware.cygnus.com Subject: expect does not timeout Date: Thu, 30 Sep 1999 23:42:00 -0000 Message-ID: X-SW-Source: 1999-09n/msg00099.html Message-ID: <19990930234200.t8PMXhf4CtEwjuxUfotuWJHWoeB5aX4hTO5zWSqCZDg@z> 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