Sorry, it has been to long ago, I couldn't recall what is was about. Nonetheless, `grep` can be replaced with `cat`:
Code:
$ head -1
one line is enough
$ cat | head -1
two lines are read in
only the first is printed
Tracing with `strace` we see that `cat` is killed by SIGPIPE
Code:
write(1, "only the first is printed\n", 26) = -1 EPIPE (Broken pipe)
--- SIGPIPE {si_signo=SIGPIPE, si_code=SI_USER, si_pid=6383, si_uid=1000} ---
+++ killed by SIGPIPE +++