From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20334 invoked by alias); 2 Oct 2014 15:56:23 -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: 33328 Received: (qmail 28294 invoked from network); 2 Oct 2014 15:56:22 -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 From: Bart Schaefer Message-id: <141002085614.ZM12193@torch.brasslantern.com> Date: Thu, 02 Oct 2014 08:56:14 -0700 In-reply-to: <20141002093509.789ff912@pwslap01u.europe.root.pri> Comments: In reply to Peter Stephenson "Re: PATCH: functions with redirections" (Oct 2, 9:35am) References: <20140929205236.2eb5e622@pws-pc.ntlworld.com> <20141001201705.23ee198d@pws-pc.ntlworld.com> <141001210741.ZM6790@torch.brasslantern.com> <20141002093509.789ff912@pwslap01u.europe.root.pri> X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: Zsh hackers list Subject: Re: PATCH: functions with redirections MIME-version: 1.0 Content-type: text/plain; charset=us-ascii 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: $ foo() { echo bar; } >$1 [schaefer@torch zsh-5.0-build]$ foo $1: ambiguous redirect $ foo /dev/null $