Re: more splitting

Bart Schaefer <[email protected]>
Newsgroups gmane.comp.shells.zsh.devel
Message-ID <CAH+w=7ZE9rWRXO=LMOu=A9o-o5P6yLMDxC=7JmDebV6XEEc+2w__21834.7089410358$1776447119$gmane$org@mail.gmail.com>
On Fri, Apr 17, 2026 at 10:11 AM Ray Andrews <[email protected]> wrote:
>
>> Zsh's slightly-older sister Bash has a built-in function called readarray that splits input on a delimiter and puts the resulting strings into an array; it is unusual in that it does keep the delimiter around by default at the end of each element.
>
> That's about exactly what I was  suggesting in my private msg. just now.  Splitting information could be preserved very easily.  But altering the data ... wrong on principle.

You're still misunderstanding.  readarray still takes a byte stream as
input, so in most of your examples the separator information is
ALREADY "lost" before readarray would even see it.  What readarray
does is build a NEW array based on the bytes in the stream.  There's
no inherent preservation of data from a source array.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.