On Mon, 2009-02-02 at 10:57 -0500, Martin d'Anjou wrote: > Hi, > > Given this makefile: > > all: > sleep 30 && echo ok || echo not ok > > > If I hit control-c before the sleep is done, how come "not ok" is not > printed to the screen?
Because the shell that is running these commands is sent a SIGINT, and so it quits immediately. It has no chance to run any echo commands. If you want it to do so, you'll have to arrange to catch the SIGINT in your shell script (with trap) and do something with it. This kind of handling is VERY tricky to do correctly in the shell. > I just want to understand how make propagages ctrl-c to commands. All make's subshells are run in the same process group, and all signals such as generated by ^C at the terminal are always sent to all processes in that same process group. So, it's not make that propagates these signals. The POSIX environment does it. _______________________________________________ Help-make mailing list [email protected] http://lists.gnu.org/mailman/listinfo/help-make
