[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: bash, sed, SIGPIPE

From: Bruno Haible
Subject: Re: bash, sed, SIGPIPE
Date: Fri, 2 Jan 2009 01:09:58 +0100
User-agent: KMail/1.9.9

Hi Jim,

> Also, even if I do reset the shell's sigpipe handler,
> it doesn't change the fact that sed complains:
>     $ (trap - SIGPIPE; seq 1000000|sed s/1/2/|cmp -s - /dev/null )
>     sed: couldn't write 4 items to stdout: Broken pipe
>     [Exit 1]

Now this looks like a bug either in 'sed' or in your shell. I don't reproduce it
with bash 3.2.39 and sed 4.1.5.

After 'trap - SIGPIPE', sed should get a fatal SIGPIPE signal in these 

  "If action is '-' , the shell shall reset each condition to the default 

Whereas the bash manual page says:

  "If arg is absent (and  there  is  a
   single  sigspec)  or  -,  each  specified signal is reset to its
   original disposition (the value it  had  upon  entrance  to  the

Does this last parenthesized sentence mean that the 'trap' command from
build-aux/bootstrap line 263 has an effect on the 'trap' commands in all its


reply via email to

[Prev in Thread] Current Thread [Next in Thread]