OpenSSH 2.3.0p1: Broken pipe / SIGPIPE

Rachit Siamwalla rachit at ensim.com
Wed Dec 13 09:47:28 EST 2000


I believe this is normal behavior. Try it without using SSH, and it will
happen.

Basically it happens if the command on the right hand side of the pipe
exits (normally or abnormally) before the command on the left of the
pipe finishes writing its output. The fd will be closed and thus the
process on the left will get a SIGPIPE (or pipe write error if its
masked out).

-rchit

> "yes | head -1" says "Broken pipe".
> Another example is to call something like "grep foobar file | less"
> on a file with thousands of occurences of "foobar". After "less"
> has displayed the first page, if I then hit "q" (for quit), I get
> thousands of lines saying:
> 
>         grep: writing output: Broken pipe
>





More information about the openssh-unix-dev mailing list