[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
conditions.
Quoting
<http://www.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#trap>
"If action is '-' , the shell shall reset each condition to the default
value."
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
shell)."
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
subshells??
Bruno
- Re: sed, SIGPIPE, cmp -s [Re: [PATCH 3/4] gnulib-tool: abort loops early where possible., Bruno Haible, 2009/01/01
- Re: sed, SIGPIPE, cmp -s [Re: [PATCH 3/4] gnulib-tool: abort loops early where possible., Jim Meyering, 2009/01/01
- Re: bash, sed, SIGPIPE,
Bruno Haible <=
- Re: bash, sed, SIGPIPE, Eric Blake, 2009/01/01
- Re: bash, sed, SIGPIPE, Bruno Haible, 2009/01/01
- Re: bash, sed, SIGPIPE, Jim Meyering, 2009/01/02