Here is /bin/sh behaviour that surprised me, "exit" failing to exit:
$ cat sh_exit_from_while_pipe #!/bin/sh echo foobar | while read blabla do ech