Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Very weird shell & sysread behavior
- X-seq: zsh-workers 43736
- From: Sebastian Gniazdowski <sgniazdowski@xxxxxxxxx>
- To: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- Subject: Re: Very weird shell & sysread behavior
- Date: Sun, 28 Oct 2018 12:59:44 +0100
- Cc: Zsh hackers list <zsh-workers@xxxxxxx>
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=SUVsngv/AEPbsfGbYegRQbBqj9oKHBsY4XdP5QaMg0k=; b=FjfwdN0hmQL4nSOComu+uqDuUXfJntwdSUx/FArZvHk4ztvIq14BxMyGn7K698PjrI Xw+r5RQB+bbNRQh5hAZtuwmzJYb3M+XdP/z/8Tok59G9TxtDPAZKUvw/yo2JLS13vnZm i2Ep+FES7ZihrjCC9gwSfIzrPBdqkRcu1I+k6CNtJ3IT+ZZ0uM1pPKMIfqg1eQOsSgTt W3TMCwbPmR6chW4Y10KKhIHS3EJ53R/fP0GbVr+nDM1viIJBRPH7XJGqa/wBZMos9QrB kyRfZ1/uQnWjgLuCnxDsN7a5+9Gil6Ry7lWAMyMklfxStZueuVZc5WmEDIy4OvshwfLT rG5g==
- In-reply-to: <CAH+w=7YqnHcPvwLOOxD-3-OtO-h2_Bfo8VySP5i9g_A0xjsZ6A@mail.gmail.com>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- List-unsubscribe: <mailto:zsh-workers-unsubscribe@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <CAKc7PVBzb-7Hc0p6wBSmS8mTitnXo7X6j+m3_7QvRV1NgRnz1w@mail.gmail.com> <CAKc7PVDuMsRWiW53gf5yki_NPcOrqVC=2zHJNGH-Je2b312jDQ@mail.gmail.com> <CAH+w=7YqnHcPvwLOOxD-3-OtO-h2_Bfo8VySP5i9g_A0xjsZ6A@mail.gmail.com>
On Sun, 28 Oct 2018 at 06:22, Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
>
> On Sat, Oct 27, 2018 at 1:53 PM Sebastian Gniazdowski
> <sgniazdowski@xxxxxxxxx> wrote:
> >
> > Turned out the tricky output-parameter specifier, the '__tmp[(#__tmp +
> > 1)]' isn't correct. Apparently because #__tmp in math context is
> > character-code. Regular __tmp_size variable and '__tmp[__tmp_size +
> > 1]' works correctly, even when the data is printed in two print -r
> > instructions, not as the single string.
>
> You could also do __tmp[$#__tmp+1] if you want to avoid the extra variable.
Thanks, didn't try this. The extra variable has additional positive
effect – when increased for each 0 return from sysread, it doesn't
compute array length each read. But for 65kB reads, it probably
doesn't matter, as there will not be many of reads at all (to exhaust
the input FD).
Blinkenshell isn't responding, a more permanent and responsive link:
https://imgur.com/YGWYTLe
--
Sebastian Gniazdowski
News: https://twitter.com/ZdharmaI
IRC: https://kiwiirc.com/client/chat.freenode.net:+6697/#zplugin
Blog: http://zdharma.org
Messages sorted by:
Reverse Date,
Date,
Thread,
Author