GNU bug report logs - #34488
Add sort --limit, or document workarounds for sort|head error messages

Previous Next

Package: coreutils;

Reported by: 積丹尼 Dan Jacobson <jidanni <at> jidanni.org>

Date: Fri, 15 Feb 2019 14:53:01 UTC

Severity: normal

Tags: fixed

Done: Assaf Gordon <assafgordon <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


Message #56 received at 34488 <at> debbugs.gnu.org (full text, mbox):

From: Pádraig Brady <P <at> draigBrady.com>
To: Eric Blake <eblake <at> redhat.com>, 積丹尼 Dan Jacobson <jidanni <at> jidanni.org>, 34488 <at> debbugs.gnu.org
Subject: Re: bug#34488: Add sort --limit, or document workarounds for
 sort|head error messages
Date: Sun, 17 Feb 2019 18:20:19 -0800
On 15/02/19 07:20, Eric Blake wrote:
> Except that POSIX has the nasty requirement that sh started with an
> inherited ignored SIGPIPE must silently ignore all attempts from within
> the shell to restore SIGPIPE handling to child processes of the shell:
> 
> $ (trap '' PIPE; bash -c 'trap - PIPE; \
>    seq 9999 | sort -n | sed 5q | wc -l')
> 5
> sort: write failed: 'standard output': Broken pipe
> sort: write error

> You HAVE to use some other intermediate program if you want to override
> an inherited ignored SIGPIPE in sh into an inherited default-behavior
> SIGPIPE in sort.

Should we also propose to POSIX to allow trap to specify default?
Maybe `trap 0 PIPE` or similar?





This bug report was last modified 6 years and 51 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.