Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: multi-digit file descriptors
- X-seq: zsh-users 19859
- From: Peter Stephenson <p.stephenson@xxxxxxxxxxx>
- To: Zsh Users <zsh-users@xxxxxxx>
- Subject: Re: multi-digit file descriptors
- Date: Wed, 11 Feb 2015 17:46:05 +0000
- In-reply-to: <CAH+w=7aT7bpc=Z+h9dK_HBcoLytBg85syuC_TfTONZ-Rci7Dhw@mail.gmail.com>
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- Organization: Samsung Cambridge Solution Centre
- References: <20150211162637.GA9083@xvii.vinc17.org> <CAH+w=7aT7bpc=Z+h9dK_HBcoLytBg85syuC_TfTONZ-Rci7Dhw@mail.gmail.com>
On Wed, 11 Feb 2015 09:27:51 -0800
Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
> On Feb 11, 2015 8:28 AM, "Vincent Lefevre" <vincent@xxxxxxxxxx> wrote:
> >
> > The behavior of dash and ksh93 is similar to zsh. But is there any
> > reason?
>
> Zsh reserves descriptors 10 and up for internal use; for example, 10 is
> nearly always a copy of the original input terminal in an interactive shell.
You can grab use of one yourself with the recommended syntax (we
actually agreed this with David Korn):
local foo
exec {foo}>blah
echo bleugh >&$foo
and given what Bart mentioned we wouldn't be that keen to open it up
more widely.
Note there's nothing magic about foo, it just contains a number. So you
can do
local foo=12
exec {foo}>&-
etc.
pws
Messages sorted by:
Reverse Date,
Date,
Thread,
Author