From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13395 invoked by alias); 30 Sep 2014 08:48:32 -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: 33292 Received: (qmail 29566 invoked from network); 30 Sep 2014 08:48:17 -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-53-542a6e4d6216 Date: Tue, 30 Sep 2014 09:48:13 +0100 From: Peter Stephenson To: Zsh hackers list Subject: Re: PATCH: functions with redirections Message-id: <20140930094813.22965438@pwslap01u.europe.root.pri> In-reply-to: <140929180257.ZM7637@torch.brasslantern.com> References: <20140929205236.2eb5e622@pws-pc.ntlworld.com> <140929180257.ZM7637@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/4VV3fPK0Qg0MLbCwONj9kcmD0WHXw A1MAYxSXTUpqTmZZapG+XQJXxurbPcwFd1krpn75wdrAeICli5GTQ0LAROLpii/MELaYxIV7 69lAbCGBpYwSk6amdzFyAdnLmST6jjxnB0mwCKhKLDuxmwnEZhMwlJi6aTYjiC0ioCWx4+RJ sLiwgL7En40nweK8AvYS+y7sBbM5BSwlnizuYoYYup5R4uGGr2AJfqCGq38/MUFcYS8x88oZ qGZBiR+T74Fdygy0YPO2JlYIW15i85q3zBMYBWYhKZuFpGwWkrIFjMyrGEVTS5MLipPScw31 ihNzi0vz0vWS83M3MUKC8MsOxsXHrA4xCnAwKvHwJihqhQixJpYVV+YeYpTgYFYS4eXJAgrx piRWVqUW5ccXleakFh9iZOLglGpgtK+s4JJKlXfNaeloq5tzSrS+TLpFWDJFSHITz60ts/qe OO+8f7vwe9Wrtc84J15v+JYlarVveojc9MwI7hv+M+XDHc4WzgmZ8Ojfx+PfL53zefaBjVF4 rUPx32+d8+1eO2nIXntwSsT/cVfmhMUZxx+r3/Mzl1WLu3Dg7YSWVqWa2qMn7z7mVWIpzkg0 1GIuKk4EAI27SfEgAgAA On Mon, 29 Sep 2014 18:02:57 -0700 Bart Schaefer wrote: > On Sep 29, 1:53pm, Bart Schaefer wrote: > } > } foo() { echo foo; } >&3 > } foo 3>&2 > > Tried this now; happily it works the same as bash. It works by appending the list from the function definition to the list from the command line, so the effect is "3>&2 >&3" as you expect. Should probably add a test for it --- it's slightly different code from the normal case. $functions[foo] output will need a special case. I'll look at it. I don't think there's anything much to be gained by extending the special case elsewhere since it's already broadly working like other shells, and $functions is an odd one out there. pws