December 1994
Intermediate to advanced
606 pages
16h 7m
English
This section is only useful if you have multiple interpreters in a single process. If you are using vanilla Expect, then you can skip this section.
By default, the signal handler is evaluated in the interpreter in which the trap command was evaluated. It is possible to evaluate the handler in the interpreter active at the time the signal occurred by using the -interp flag.
For example, if you are running several simulations whose speeds are controlled by the variables speed (one per interpreter), you could reverse the speed by pressing ^C with the following definition in effect:
trap -interp {
set speed [expr -speed]
} SIGINT
Read now
Unlock full access