On 4/14/15 2:46 PM, Nikola Kržalić wrote: > I wonder if this is the correct behavior in interactive bash as well? > Because if I do this via ssh my connection drops as well and I have to > reconnect. Shouldn't just echo return a non-zero exit code?
Bash doesn't perform any special handling on receipt of SIGPIPE; it's just another fatal signal. The kernel generates it when a process tries to write to a pipe with no reader or an unconnected socket, interactive or not. Bash doesn't (and shouldn't) try to handle it internally. If you want to trap or ignore it, you or your script can decide on the right thing to do. -- ``The lyf so short, the craft so long to lerne.'' - Chaucer ``Ars longa, vita brevis'' - Hippocrates Chet Ramey, ITS, CWRU c...@case.edu http://cnswww.cns.cwru.edu/~chet/