0

While exec is running a program, I would like Ctrl-C to terminate the program and resume the script, instead of killing the script. What's the best way of accomplishing that?

Garrett
  • 4,217
  • 1
  • 24
  • 33
LaC
  • 3,019

2 Answers2

0

See if this works: package require Tclx

If it can, then you can trap signals with the signal command.

glenn jackman
  • 27,524
0

I ended up running the program using exec and using expect's trap command to intercept SIGINT. The subprogram is still terminated (in fact, there may not be a way to avoid this is using exec), but by using trap and a catch around exec, the tcl script can continue executing.

LaC
  • 3,019