samedi 29 novembre 2014

Bash: issuing trap twice


I have a very simple question. I can't believe the Bash manpage doesn't explain this already, but anyway...


If I issue the trap builtin twice [for the same signal], what happens? Is the second command added to the first, or does it replace the first?



trap Foo SIGINT
...
trap Bar SIGINT
...


When SIGINT happens, does Bash just run Bar, or does it run Foo as well? Or something else...?



Aucun commentaire:

Enregistrer un commentaire