From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8446 invoked by alias); 10 Mar 2013 18:27:00 -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: 31138 Received: (qmail 4168 invoked from network); 10 Mar 2013 18:26:58 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 Received-SPF: none (ns1.primenet.com.au: domain at closedmail.com does not designate permitted sender hosts) From: Bart Schaefer Message-id: <130310112656.ZM14395@torch.brasslantern.com> Date: Sun, 10 Mar 2013 11:26:56 -0700 In-reply-to: Comments: In reply to Mikael Magnusson "Re: Somewhat unexpected results of {myfd}>&1 when noclobber set" (Mar 10, 1:11pm) References: <130309071252.ZM19892@torch.brasslantern.com> X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: zsh workers Subject: Re: Somewhat unexpected results of {myfd}>&1 when noclobber set MIME-version: 1.0 Content-type: text/plain; charset=us-ascii On Mar 10, 1:11pm, Mikael Magnusson wrote: } } On 9 March 2013 16:12, Bart Schaefer wrote: } } > integer bar=1+1 } > print something >&$bar } } Well, this 1+1 is evaluated when you assign to bar, not when you do >&$bar... } (not ignoring the rest of the message, just replying to this part for now). } } % foo=1+1 } % echo $foo } 1+1 } % print something >&$foo } } results in the file 1+1 being created with contents 'something'. You missed the very important "integer" declaration. If you change your test to begin % integer foo=1+1 you will get a very different result. Because the variables created with {foo}>& are implicitly given integer type, you have to try >&$foo with an integer foo, not an ordinary scalar foo.