Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: PATCH: Re: Multi-redirection bug



I wrote:
> The SIGPIPE is inevitable, but the shell usually doesn't exit on
> it, so there may be something else wrong.

This may be nonsense.

% (echo foo; sleep 1; echo bar >& 2) | (read >/dev/null)
bar
% (echo foo; sleep 1; echo foo2; echo bar >& 2) | (read >/dev/null)
% print $pipestatus                                                
141 0

The sleep is necessary so that the read process has really exited (`by a
sleep to say we end the heartache' etc.).  In that case the shell process
does get SIGPIPE (13 on Solaris + 128 for a signal) and exit.

Still, it worries me that it can be so drastically affected by the
behaviour of trivial subprocesses like the multios helpers.

-- 
Peter Stephenson <pws@xxxxxxxxxxxxxxxxxxxxxxxxx>
Cambridge Silicon Radio, Unit 300, Science Park, Milton Road,
Cambridge, CB4 0XL, UK                          Tel: +44 (0)1223 392070



Messages sorted by: Reverse Date, Date, Thread, Author