bug-bash
[Top][All Lists]
Advanced

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

Re: "echo: write error: Broken pipe" even when DONT_REPORT_SIGPIPE set


From: Chet Ramey
Subject: Re: "echo: write error: Broken pipe" even when DONT_REPORT_SIGPIPE set
Date: Mon, 09 Jan 2006 14:22:11 -0500
User-agent: Thunderbird 1.5 (Macintosh/20051201)

Tim Waugh wrote:
> Comparing bash-3.0 (with config-top.h modified so that
> DONT_REPORT_SIGPIPE is defined) with bash-3.1 (where this is the
> default anyway) shows up a change in behaviour.
> 
> bash-3.0:
> 
> $ bash -c 'trap exit SIGPIPE; echo foo' | :
> $ 
> 
> bash-3.1:
> 
> $ bash -c 'trap exit SIGPIPE; echo foo' | :
> bash: line 0: echo: write error: Broken pipe
> $ 
> 
> Is this change in behaviour intentional, or a regression?

It's intentional, and doesn't have anything to do with job control
or processes dying from SIGPIPE in general.  There were several bug
reports filed against bash-3.0 complaining that the only way to
check whether or not echo failed to write requested data was to use
the exit status.  (Mostly in connection with redirected output on a
full or unavailable file system.)  `echo' now displays an error
message on write errors.  `printf' does the same thing.

Chet

-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
( ``Discere est Dolere'' -- chet )
                                                Live Strong.
Chet Ramey, ITS, CWRU    chet@case.edu    http://tiswww.tis.case.edu/~chet/




reply via email to

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