From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5134 invoked from network); 11 Jul 2006 16:24:02 -0000 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00, FORGED_RCVD_HELO autolearn=ham version=3.1.3 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 11 Jul 2006 16:24:02 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 30382 invoked from network); 11 Jul 2006 16:23:53 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 11 Jul 2006 16:23:53 -0000 Received: (qmail 9804 invoked by alias); 11 Jul 2006 16:23:51 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 22548 Received: (qmail 9795 invoked from network); 11 Jul 2006 16:23:50 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 11 Jul 2006 16:23:50 -0000 Received: (qmail 30103 invoked from network); 11 Jul 2006 16:23:50 -0000 Received: from vms042pub.verizon.net (206.46.252.42) by a.mx.sunsite.dk with SMTP; 11 Jul 2006 16:23:47 -0000 Received: from torch.brasslantern.com ([71.116.74.94]) by vms042.mailsrvcs.net (Sun Java System Messaging Server 6.2-4.02 (built Sep 9 2005)) with ESMTPA id <0J2800C7EYVAD4G5@vms042.mailsrvcs.net> for zsh-workers@sunsite.dk; Tue, 11 Jul 2006 11:23:35 -0500 (CDT) Received: from torch.brasslantern.com (localhost.localdomain [127.0.0.1]) by torch.brasslantern.com (8.13.1/8.13.1) with ESMTP id k6BGNXJ6017492 for ; Tue, 11 Jul 2006 09:23:33 -0700 Received: (from schaefer@localhost) by torch.brasslantern.com (8.13.1/8.13.1/Submit) id k6BGNXG4017491 for zsh-workers@sunsite.dk; Tue, 11 Jul 2006 09:23:33 -0700 Date: Tue, 11 Jul 2006 09:23:33 -0700 From: Bart Schaefer Subject: Re: Test issues In-reply-to: <200607111530.k6BFU0mG023293@news01.csr.com> To: zsh-workers@sunsite.dk (Zsh hackers list) Message-id: <060711092333.ZM17490@torch.brasslantern.com> MIME-version: 1.0 X-Mailer: OpenZMail Classic (0.9.2 24April2005) Content-type: text/plain; charset=us-ascii References: <20a807210607110749q205d2d07n5b6957098a3ca5a1@mail.gmail.com> <200607111530.k6BFU0mG023293@news01.csr.com> Comments: In reply to Peter Stephenson "Re: Test issues" (Jul 11, 4:29pm) On Jul 11, 4:29pm, Peter Stephenson wrote: } } + myfd= } exec {myfd}>logfile } - print This is my logfile. >&$myfd } - print Examining contents of logfile... } - cat logfile } + if [[ -z $myfd ]]; then } + print "Ooops, failed to set myfd to a file descriptor." >&2 That's not going to help. The problem is that if {mytfd} is not recognized as a file descriptor, it's taken as a command, and the "exec" causes the test script to replace itself with nothing (and effectively exit). The real solution is to put the entire thing in a subshell, I think.