Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
zsh silently abandons compound command on trying to write to a closed file descriptor
- X-seq: zsh-workers 39741
- From: Martijn Dekker <martijn@xxxxxxxx>
- To: Zsh hackers list <zsh-workers@xxxxxxx>
- Subject: zsh silently abandons compound command on trying to write to a closed file descriptor
- Date: Thu, 27 Oct 2016 18:21:31 +0100
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
zsh misbehaves if a redirection produces an error due to writing to a
closed file descriptor. For instance,
echo hi >&- || echo oops
doesn't output "oops" as expected. But the shell is not exited, only the
current compound command is apparently abandoned -- silently, without an
error message or even a non-zero exit status.
Test script:
echo hi >&- || ! echo oops
echo $?
'zsh test.sh' and 'zsh -o posixbuiltins test.sh' both output 0 (and
nothing else). Expected output is an error message followed by "oops"
followed by 1.
Relevant POSIX text is at:
http://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_08_01
Thanks,
- M.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author