Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Writing good SIGINT handler is a bit tricky. You should re-raise the signal, so that bash notices that the program was actually interrupted:

https://www.cons.org/cracauer/sigint.html (section "How to be a proper program")

Most of the time, especially for short lived script, adding signal handlers is not worth the trouble.



Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: