From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10534 invoked by alias); 29 Feb 2016 06:45:04 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 38044 Received: (qmail 23081 invoked from network); 29 Feb 2016 06:45:00 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.1 Message-ID: <56D3E8E4.6090007@inlv.org> Date: Mon, 29 Feb 2016 07:44:52 +0100 From: Martijn Dekker User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 MIME-Version: 1.0 To: Zsh hackers list Subject: [bug?] Invalid file descriptor ignored Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit 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.