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

Re: Very weird shell & sysread behavior



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.



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