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

Re: Fwd: more splitting travails




On 2024-01-12 19:59, Bart Schaefer wrote:
The outermost parens say that you are ASSIGNING TO an array, not WHAT
you are assigning to it.

Ah!  Output, not input.  Obvious now that you mention it.


> But ... aaa is not the name of an array, after the foregoing "read".
Or if it somehow is, we're back to an array of one element where that
element has all the newlines within.

Well, Roman will be glad to hear that I was just about to do a typeset -p on both versions to see the difference.  I'll have to think about it, but for now what matters is just that I see it correctly, even if that's via a cheat -- it shows the array as it is even if via a somewhat strange route.


0 /aWorking/Zsh/Source/Wk 0 % typeset -p vvar
typeset -a vvar=( 'one two' three '' four '' 'five six seven' '' '' eight )

0 /aWorking/Zsh/Source/Wk 0 % typeset -p aaa 
typeset aaa=$'one two\nthree\n\nfour\n\nfive six seven\n\n\neight'

I won't forget again.





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