Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
[bug?] Invalid file descriptor ignored
- X-seq: zsh-workers 38044
- From: Martijn Dekker <martijn@xxxxxxxx>
- To: Zsh hackers list <zsh-workers@xxxxxxx>
- Subject: [bug?] Invalid file descriptor ignored
- Date: Mon, 29 Feb 2016 07:44:52 +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
There is some strange and inconsistent behaviour when trying to write to
a non-open file descriptor. I think the following three test cases
should at least return a non-zero status, but only the third one does:
% echo hi 1>&-; echo $?
0
% { echo hi; } 1>&-; echo $?
zsh: write error: bad file descriptor
0
% echo hi 2>&- 1>&2; echo $?
zsh: 2: bad file descriptor
1
Other shells behaviour, FWIW: All other shells return a non-zero status
for all three cases. (d)ash, bash, yash produce an error message for the
first two cases but not the third. ksh88, ksh93 and {pd,m}ksh are silent
on all three.
Thanks,
- M.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author