Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: PATCH: functions with redirections



On Mon, 29 Sep 2014 18:02:57 -0700
Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> 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



Messages sorted by: Reverse Date, Date, Thread, Author