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

Re: Fwd: more splitting travails




On 2024-01-12 12:03, Bart Schaefer wrote:
This was sent privately to me but pretty obviously intended for the list.
I got a private copy from Mark, but with a cc to the list.


Well, here's where the exception to that "usually" comes in.

cut ... I'll need time to digest all this ...


Yesss.  When it's captured as one element I see the newlines because are all there in the single element! ... it looks split but it isn't !! So I think I'm getting closer to what I want but actually I'm further way.

    % vvar=("${(@f)"$(<testfile2)"}")


1 /aWorking/Zsh/Source/Wk 0 % vvar=("${(@f)"$(<testfile2)"}") ; print -l "$vvar[@]"; print "\n ... and the number of elements is: ..... $#vvar \n Ta-Taaaa :-)
"
one two
three

four

five six seven


eight

 ... and the number of elements is: ..... 9
 Ta-Taaaa :-)

... and that's not as Byzantine as it looks: " (@f) : read: "include blank lines, and split on newlines (including empty lines) "   ... Yes?

Yes, more invisible differences.  Old printout and new printout look identical but internally they're chalk and cheese.





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