bug-coreutils
[Top][All Lists]
Advanced

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

bug#34488: Add sort --limit, or document workarounds for sort|head error


From: Pádraig Brady
Subject: bug#34488: Add sort --limit, or document workarounds for sort|head error messages
Date: Sun, 17 Feb 2019 18:20:19 -0800
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0

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?






reply via email to

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