Somewhere in that book, I'm sure it is explained that when reading from STDIN, you must send EOF signal. i.e. CTRL-C