. Some platforms implement alarm using sleep (or something like that - some tidbit of info I picked up somewhere), so mixing those two together is not good. If you replace your
, it will not work -- you get a success with the select() version and the script 'hangs' waiting for input with the STDIN version (on my system anyhow). Just as if the signal was never received.