Bruno Haible <[EMAIL PROTECTED]> writes: > POSIX says that "trap ''" makes the shell "ignore each specified condition > if it arises". That means, if the user presses Ctrl-C, the shell will > continue to run. That's not what I want here. I just wish the Ctrl-C > to trigger no additional commands, and "trap :" looks right for doing this.
But POSIX says that "trap : 2" is normally equivalent to "trap '' 2", as far as the shell itself is concerned. The main difference is that with "trap : 2", subcommands can be interrupted by signal 2, whereas with "trap '' 2", subcommands ignore signal 2. Therefore, this change to gnulib-tool: > - trap - 0 1 2 3 15 > + trap : 0 1 2 3 15 has a real effect on how gnulib-tool behaves: it causes the shell to continue after a subcommand was interrupted, rather than exiting. I doubt whether this change was intended. The difference can be seen with this script: trap : 2 sleep 5 sleep 10 If you execute this with "bash -x", and interrupt the "sleep 5" with Control-C, you'll see that the "sleep 10" is executed with "trap :", whereas it would not be executed with "trap -". How about if you replace this: trap : 0 1 2 3 15 with this? trap '' 0 trap '(exit $?); exit $?' 1 2 13 15 _______________________________________________ bug-gnulib mailing list bug-gnulib@gnu.org http://lists.gnu.org/mailman/listinfo/bug-gnulib