From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13898 invoked by alias); 2 Oct 2014 16:13:51 -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: 33333 Received: (qmail 20807 invoked from network); 2 Oct 2014 16:13:49 -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=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI, SPF_HELO_PASS autolearn=ham version=3.3.2 X-AuditID: cbfec7f4-b7f156d0000063c7-b9-542d775fb4c4 Date: Thu, 02 Oct 2014 17:03:42 +0100 From: Peter Stephenson To: Zsh hackers list Subject: Re: PATCH: functions with redirections Message-id: <20141002170342.5caa131a@pwslap01u.europe.root.pri> In-reply-to: <141002085614.ZM12193@torch.brasslantern.com> References: <20140929205236.2eb5e622@pws-pc.ntlworld.com> <20141001201705.23ee198d@pws-pc.ntlworld.com> <141001210741.ZM6790@torch.brasslantern.com> <20141002093509.789ff912@pwslap01u.europe.root.pri> <141002085614.ZM12193@torch.brasslantern.com> Organization: Samsung Cambridge Solution Centre X-Mailer: Claws Mail 3.7.9 (GTK+ 2.22.0; i386-redhat-linux-gnu) MIME-version: 1.0 Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7bit X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFuplluLIzCtJLcpLzFFi42I5/e/4Fd34ct0Qg2nHmC0ONj9kcmD0WHXw A1MAYxSXTUpqTmZZapG+XQJXxvS5z1gLJrBW9K9fzNbA+Ju5i5GTQ0LAROJ9z2cmCFtM4sK9 9WwgtpDAUkaJZ598uxi5gOzlTBI7vlwHS7AIqEo8XP4VzGYTMJSYumk2I4gtIqAlsePkSbBB wgL6En82ngSL8wrYS8z69YYVxOYUsJKYvX4tO8TQHmaJF3+esoAk+IEarv79BHWFvcTMK2eg mgUlfky+B1bDDLRg87YmVghbXmLzmrfMExgFZiEpm4WkbBaSsgWMzKsYRVNLkwuKk9JzDfWK E3OLS/PS9ZLzczcxQoLwyw7GxcesDjEKcDAq8fBmNOiECLEmlhVX5h5ilOBgVhLh1YvSDRHi TUmsrEotyo8vKs1JLT7EyMTBKdXAuFp51lZhY7l13v6Jh79qP3pu8j9+3s//kgxfakRNXX65 ++hFib8pXf3Q1GabTcefs3+mvPA+vuM418YNny3mq4u2XP9rqvX9MM9c4yeeu7fPKRbZtLGr T3DH7Yy/GzYsrBeWTRF8VdkR8tT6SoHI9A9bpy9x2nz80uHzDV3l66Orn7LETA92dlRiKc5I NNRiLipOBACb2932IAIAAA== On Thu, 02 Oct 2014 08:56:14 -0700 Bart Schaefer wrote: > On Oct 2, 9:35am, Peter Stephenson wrote: > } > } > } +function is executed. Any variables in the redirection are expanded > } > } +at the point the function is executed, but outside the function scope. > } > > } > ... is actually the way it's supposed to work. > > Bash appears to evaluate the redirects IN the function scope: We don't really have that option without a great deal of code rearrangement and, while I presume in that case it's the right thing to do, it's not obvious from the syntax. So it can stay the way it is for now. pws