>> How do you signal EOF?
> Ctrl-D on a blank line.
For completeness, we should mention that this is true on Unix-like systems. For Windoze CMD shell, for instance, it would be Ctrl-Z. Though the #! line of the OP's program suggests that he is indeed using such a system, we can not conclusively...