From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,HTML_MESSAGE,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham autolearn_force=no version=3.4.4 Received: from zero.zsh.org (zero.zsh.org [IPv6:2a02:898:31:0:48:4558:7a:7368]) by inbox.vuxu.org (Postfix) with ESMTP id E35F22232F for ; Sat, 13 Apr 2024 19:20:53 +0200 (CEST) ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1713028853; b=iXT3A/r3SfBPIIAPgJG3d0xbgJX+69d894TsmAeiwEireFrtP4yS9uQCkEfGhz+Ov7xk8LKp+u /JCCjtATEkQPRISuqmlmMjbDzYeGKhnNQzU4GAbphlQUjzLK1hpTHHCn/TC2yv10NQpsBUBSau 7736skyLfcXixV1eXY6+3NDbL2u2q8MXuL4nVCFOi0duVNw5RuZ5VAWrJ/anf9CQxNq+TUUITt YGjPXjSLHeWjKTT2lezbQ1/bJGHKEM/68FR5Z/67ioDbLjxmY9fmsiixqpNYLCDlYb8fHvmc56 71pTrAvqt6sLHJHhG8HKagqIfDOwX9XIvDICFJHS18G2BQ==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-lj1-f170.google.com) smtp.remote-ip=209.85.208.170; dkim=pass header.d=gmail.com header.s=20230601 header.a=rsa-sha256; dmarc=pass header.from=gmail.com; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20210803; t=1713028853; bh=3YMNT/0BHGjVuRJtgkW3Ba3ud3lSNxrsajOGxR4VGDQ=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Type:To:Subject:Message-ID:Date:From:In-Reply-To: References:MIME-Version:DKIM-Signature:DKIM-Signature; b=k/nrGDOh99QKQZ02YMUMbmIIGlmIFV0QTjm+m90bOcNECCStliCTGW55jywRpfxGtrI/XCXxws YTuRnlnKpb6m+ZphmlYPwE3neD7cJXJuCLLe8dou1sPeMXhmI5O/PT5O0s27mkEIevMHsnbhob RUHYWBS0qYKb0B8YaZfa4zhjzoYKU+rNeudLlnCuyE1cQwQ6kHUQCgYtsEdzzGXx+W9ykfGn0K 2DV6WgAQeKAvZEoSIW1++GZKAr2wdDHtHkFsT9z/hJyBW/GrOKb1lG8WpHMEpHD4PdHneOEey9 r9i/bOTBwljsMS6QnZeCrrl7wNFLJVixCyRcTopxDdc1Sg==; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=zsh.org; s=rsa-20210803; h=List-Archive:List-Owner:List-Post:List-Unsubscribe: List-Subscribe:List-Help:List-Id:Sender:Content-Type:To:Subject:Message-ID: Date:From:In-Reply-To:References:MIME-Version:Reply-To:Cc: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=BEUxbXoAzY4KT3H0K9j6NzoN8gAlOLaClnOPV2FnXKE=; b=sugTCywkf1JeQ+0EZZrDo7HQ5M X9FlH3WLaABtmyxjzA0Nx96Wuh58/36cMFPt1bqhbNLC6t4UTXtrmnF40/vgZQ2tmjm2/NmKExiZT AQlhHQx4+s07nZjX7fa98k1uEUH3fLX1m+yQEXaK8AAR5Lil/t8MR487PKaG+1C+UGqFJZC7ETCCj /wlbP+rs//1/5rvThRH4M0QwsC5imb4Pq+SzSn8ocWFW56q/IzhR16XLGZyo/FvOUlZNeDfeZQ9zo 0jFCciO5/LhaS7xj/ynrRPT/mQ94u8RAm4thnR5np1gmFdJhZeJztrm2keUbTgiBDCv4MZlqlRHEQ 8tlcMSyw==; Received: by zero.zsh.org with local id 1rvh3d-000HDr-5Q; Sat, 13 Apr 2024 17:20:53 +0000 Authentication-Results: zsh.org; iprev=pass (mail-lj1-f170.google.com) smtp.remote-ip=209.85.208.170; dkim=pass header.d=gmail.com header.s=20230601 header.a=rsa-sha256; dmarc=pass header.from=gmail.com; arc=none Received: from mail-lj1-f170.google.com ([209.85.208.170]:49345) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1rvh2k-000GV1-0C; Sat, 13 Apr 2024 17:19:59 +0000 Received: by mail-lj1-f170.google.com with SMTP id 38308e7fff4ca-2d6c9678cbdso23365741fa.2 for ; Sat, 13 Apr 2024 10:19:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1713028796; x=1713633596; darn=zsh.org; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :from:to:cc:subject:date:message-id:reply-to; bh=BEUxbXoAzY4KT3H0K9j6NzoN8gAlOLaClnOPV2FnXKE=; b=kOXiBJhZru8gqo36Csq91qIKxYwCGCXqLeanhApKy8Jayzz2+apqFiCkPvVt3+gif6 OJ6M5K8a0P+Dhy6JD3IAogz2abOWucRgAMkGkT7Tg0VW7JDmMPc67FfUMTnReu9FmdE0 uW6OAyiOJdiCCMCXzeWftdVM+4yvZ5ow/pGcPqIkUjHFaEJazy0x4nIkEp3sR7Nbx+Xb SHSLXoqbtUlWZU7vNYgVdS+CuG00eSV8ILXw3dSaC1O43W3oWCb+AlKukbQ2ykFRVmGW +XgGTnjiJK9p//cMD4tv5HspIb1FVd10kRBpcxjJ6q3cxh9i67nd+HOuERDhFEicamQw lF4A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713028796; x=1713633596; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=BEUxbXoAzY4KT3H0K9j6NzoN8gAlOLaClnOPV2FnXKE=; b=HQ648JdAuykJLXEdA0JtKLQYWR6HBfrakTEjR0b9UdGK/mpi5IfyQ0EEfiDZ7PMUqN Gh3xWHK/rqhzBa8Iamf6/n2AnGU86orvq6qKT/lVTLQeGa2H1Ug6MRMKDd1rMhrG3+S2 J9yTwf3ZtptT0tnHsx+zyYnXoWAr4G5+wQq0kM+GZrYd/sreVNpS38bor3872gD/0rnr jIQaGBhYWKIcIrwYUb4Akf8QHhaU2lOaWkkOfNe4qHA09Oo+/95ICQOMUc129X+Lk5CS NeCmxdT3d8br0jDhEL8fUvEPmRTczoIIqKzX5SsllJQ/TXfV2SkIqtXX71oXi2EUxXoz ECWQ== X-Gm-Message-State: AOJu0YyaDhuAldIL8oGKN2k0PG2rDidCBaBsTDbdJs3EOryrdlCF2Jsc mO/DjvmFCBnEDyCy5IO5ABRLD16r55Kq2ILlIcnr9X+AzD4Xdn8O6lmIxoqqP/zQV8cmKJeg9PU b/VChG0/UrA/o/q1Lm2W04G9ryE91U9Sb1N0= X-Google-Smtp-Source: AGHT+IFAKV9JBxmrcKwSuB4KxZBzS79+TLiLHYW9hqwW+mx8IJT7R7RxQ6oW44uxHL4BVIRphx7M2ILvJENaY9EDAsE= X-Received: by 2002:a2e:8695:0:b0:2d8:a921:dfc1 with SMTP id l21-20020a2e8695000000b002d8a921dfc1mr3733273lji.20.1713028796038; Sat, 13 Apr 2024 10:19:56 -0700 (PDT) MIME-Version: 1.0 References: <97793422-1543-4ba6-b52b-ff93eba03ab1@eastlink.ca> <7ba17739-6024-439b-a4a7-dd88fddfa2e4@eastlink.ca> <7333cf23-1fe7-4b3d-a7c1-f07697c5f062@eastlink.ca> <1e53a3f7-9bdb-45ae-81c7-7d0ec1a6a541@app.fastmail.com> <3cc19e86-e953-4e2f-9e57-30ff84f15fdf@eastlink.ca> In-Reply-To: From: "Mark J. Reed" Date: Sat, 13 Apr 2024 13:19:43 -0400 Message-ID: Subject: Re: triviality regarding $# counts To: zsh-users@zsh.org Content-Type: multipart/alternative; boundary="000000000000e0c6b60615fd9809" X-Seq: 29804 Archived-At: X-Loop: zsh-users@zsh.org Errors-To: zsh-users-owner@zsh.org Precedence: list Precedence: bulk Sender: zsh-users-request@zsh.org X-no-archive: yes List-Id: List-Help: , List-Subscribe: , List-Unsubscribe: , List-Post: List-Owner: List-Archive: --000000000000e0c6b60615fd9809 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hm. *typeset* -ga aaa=3D(*"* *abc* * def ghi* * jkl mno* * pqr* *"*) This makes *aaa* an array with a grand total of 1 element. Then you do this= : redline *"linecount of aaa is: *$#aaa* ... Single element!"* Your prefix text is wrong; calling *$# *a "linecount" is a gross mischaracterization. It never ever ever counts lines. Never. It counts characters on a scalar variable, elements of an array. Lines have nothing to do with it. There are various transformations you can do that will map between lines on the one hand and array elements on the other, but that's always some command or special expansion flag doing an explicit transformation of the data - which is to say, changing it. Inside an array there is no concept of "lines" anywhere. By the same token, a piece of text containing newlines is not inherently any sort of array at all. (Well, zsh lets you treat a non-array variable as an array of individual characters, so in that sense it is an array, but each character is its own element in that case, and newlines are not in any way special.) After your above declaration, the variable *aaa* is an array. The parentheses in the assignment would make it one even if you hadn't done *typeset -a*. Unless you un-array-ify the varaible, *$#aaa* will always be *the number of elements in the array*. It doesn't matter whether any of those elements contain newlines or not. Your initialization has exactly one element, so *$#aaa* is 1. End of story. You display things with *print -l* *$array* a lot; that's one of those transformations I mentioned above. When you do that to an array (and *print= f '%\n' "${array[@]}"* does much the same thing in a POSIX-standard way), you will get output that *starts *each element of the array on a separate line. But that's all it does. Any newlines inside any of the array elements still show up as newlines in the output. So there is no guarantee that e.g. *prin= t -l $ary | wc -l * will produce the same number as *$#ary*. In your *aaa* example, *print -l $aaa *gets you 8 lines. But it's still a single-element array. There is no *$aaa[put anything in here]* expression that will isolate any of the lines of text; your only option is the whole thing, because it's all one element. (You can use the "a string is an array of characters" trick to get substrings of that one element, e.g. *${aaa[1][2,4]}* is "abc". But again, the inner array is of *characters**, *not lines.) Then you do this, using another transformation: the *f* expansion flag: ccc=3D( ${(@f)aaa} ) By not putting double quotes around the expansion of aaa, you are throwing away all the blank lines in its expansion. Since this is followed by a version using the quotes, I assume that's intentional. But as far as I can tell, the lack of quotation marks also removes any point for including the *@* flag, since that flag's job is to maintain the identity of the separate elements of an array when the expansion is quoted. If it does anything at all when not quoted, I'm unaware of it, but I admit that I could just be ignorant of some subtlety. ddd=3D( *"*${(@f)aaa}*"* ) Now you're keeping the blank lines, so the (f) gives you a separate array element for every line that you get from the expansion - 8 of them, the same as the output of *print -l $aaa | wc -l*. redline *'\nddd=3D( "${(@f)aaa}" ) ... it seems like a lot of trouble to co= py the array as it is.'* That comment confuses me; you aren't copying the array as it is at all! You've gone from *aaa, *which has one element, to *ddd *having 8 elements. That's a far cry from "copying as it is". Your next comment says "8 not 6". I assume the expected 6 would be the middle lines, without the leading and trailing blank ones, but I know of no expansion that will produce that. You can get 6 elements out of *aaa*, like this: *eee=3D( $=3Daaa )* But it gets there by throwing away all space, including newlines. So the six elements will be simply "abc", "def", "ghi", "jkl", "mno", and "pqr" On Sat, Apr 13, 2024 at 11:14=E2=80=AFAM Ray Andrews wrote: > I dunno. I've lost the example that I saved. Never mind, I'll keep an ey= e on it, and figure out next time. Red herring for now. It's a bit confusi= ng looking into typeset -p output. All this 'splitting' stuff is not simple= . For now everything works and I'm quite sure it's a bit more orthodox. > > > > A script: > > -------------------------------------------------------------------------= -------- > > redline () { echo -e "$red$@$nrm" } > > typeset -ga aaa=3D(" > abc > > def ghi > jkl mno > > pqr > ") > > redline "\naaa:" > print -l $aaa > redline "\naaa[1]:" > print -l $aaa[1] > redline "linecount of aaa is: $#aaa ... Single element!" > > ccc=3D( ${(@f)aaa} ) > > redline '\nccc=3D( ${(@f)aaa} )' > print -l $ccc > redline "linecount of ccc is: $#ccc ... split, but blank lines gone." > > ddd=3D( "${(@f)aaa}" ) > > redline '\nddd=3D( "${(@f)aaa}" ) ... it seems like a lot of trouble to c= opy > the array as it is.' > print -l "$ddd[@]" #... don't forget the quotes, idiot!" > redline "linecount of ddd is: $#ddd ... split, but blanks preserved and > counted. NB EIGHT NOT SIX!" > > redline "\nddd[1]: That's right it's blank, just as it should be." > print -l $ddd[1] > redline "\nddd[2]:" > print -l $ddd[2] > > redline "And now the typesets\n" > typeset -p aaa > typeset -p ccc > typeset -p ddd > > # Verbatim: > > # typeset -a aaa=3D( $'\nabc\n\n\tdef ghi\n\tjkl mno\n\n\tpqr\n' ) > # typeset -a ccc=3D( abc $'\tdef ghi' $'\tjkl mno' $'\tpqr' ) > # typeset -a ddd=3D( '' abc '' $'\tdef ghi' $'\tjkl mno' '' $'\tpqr' '' ) > > # Aligned: Note the steeenking dollars ;-) ... and how they seem to > replace the newlines. No? > > # typeset -a aaa=3D( $'\nabc \n\n\tdef ghi \n\tjkl mno \n\n\tpqr\n' > ) #Original with blanks > # typeset -a ccc=3D( abc $'\tdef ghi' $'\tjkl mno ' $'\tpqr' ) > #No blanks. > # typeset -a ddd=3D( '' abc '' $'\tdef ghi' $'\tjkl mno' '' $'\tpqr' '' > ) #Blanks retained BUT not the same structure! > > > -------------------------------------------------------------------------= ---------- > > ... so what about the dollars? > > Anyway, it comes clear: '${(@f)....}' doesn't ADD (or retain) newlines it > removes them! (Tho splitting the array where they used to be.) Doesn't > need them cuz elements aren't separated by newlines (like I thought) but = by > ... however it's done. Single quotes indicate elements. And, best of al= l, > copying an array, blanks and all, (not shown above) turns out to be simpl= e: > > eee=3D( $aaa ) and: > > eee=3D( "{$(@f)aaa}" ) > > ... turns out to be a false equivalence where newlines are REMOVED. Don'= t > be fooled by 'printf' -- it might not show you the genuine state of the > array. Scalars show their blank lines automatically but we need: > > print -l -- "$eee[@]" > > ... with arrays. Trust typedef -p. > > > --=20 Mark J. Reed --000000000000e0c6b60615fd9809 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hm.

typeset -ga aaa=3D("

abc


=C2= =A0 =C2=A0 def ghi

=C2=A0 =C2=A0 jkl mno


=

=C2=A0 =C2=A0 pqr

")

This makes aaa an array with a grand total of 1 eleme= nt. Then you do this:

<= div>

redline "linecount of aaa is: $#aaa ... Single element!"

<= b>

Your prefix text is wrong;=C2=A0cal= ling=C2=A0=C2=A0$# a "linecount" is a gross mischaracteriz= ation. It=C2=A0never ever ever counts lines.=C2=A0 Never. It counts charact= ers on a scalar variable, elements of an array.=C2=A0 Lines have nothing to= do with it.

There are various transformations you can d= o that will map between lines on the one hand and array elements on the oth= er, but that's always some command or special expansion flag doing an e= xplicit transformation of the data - which is to say, changing it. Inside a= n array there is no concept=C2=A0of "lines" anywhere. By the same= token, a piece of text containing newlines is not inherently any sort of a= rray at all. (Well, zsh lets you treat a non-array variable as an array of = individual characters, so in that sense it is an array, but each character = is its own element in that case, and newlines are not in any way special.)<= div>

After your above declaration, the variable aaa= is an array. The parentheses in the assignment would make it one even = if you hadn't done typeset -a. Unless you un-array-ify the varai= ble,=C2=A0$#aaa=C2=A0will always be=C2=A0the number of elements i= n the array. It doesn't matter whether any of those elements contai= n newlines or not.=C2=A0 Your initialization has exactly one element, so $#aaa=C2=A0is 1. End of story.

You display th= ings with=C2=A0print -l=C2=A0$array a lot; that's one of = those transformations I mentioned above. When you do that to an array (and= =C2=A0printf '%\n' "${array[@]}"=C2=A0does = much the same thing in a POSIX-standard way), you will get output that=C2= =A0starts=C2=A0each element of the array on a separate line. = But that's all it does. Any newlines inside any of the array elements s= till show up as newlines in the output. So there is no guarantee that e.g.= =C2=A0print -l $ary | wc -l=C2=A0=C2=A0will produce the same number = as $#ary.=C2=A0 In your aaa=C2=A0example, print -l $aaa=C2= =A0gets you 8 lines. But it's still a single-element array. There i= s no $aaa[put anything in here]=C2=A0expression that will isolate an= y of the lines of text; your only option is the whole thing, because it'= ;s all one element.=C2=A0 (You can use the "a string is an array of ch= aracters" trick to get substrings of that one element, e.g. ${aaa[1= ][2,4]}=C2=A0is "abc".=C2=A0 But again, the inner array is of= characters, not=C2=A0lines.)

Then y= ou do this, using another transformation: the f=C2=A0expansion flag:=

ccc=3D( ${(@f)aaa} )


By not putting double quotes around the expansion of aaa, you are throwi= ng away all the blank lines in its expansion. Since this is followed by a v= ersion using the quotes, I assume that's intentional. But as far as I c= an tell, the lack of quotation marks=C2=A0also removes any point for=C2=A0i= ncluding the @=C2=A0flag, since that flag's job is to maintain t= he identity of the separate elements of an array when the expansion is quot= ed.=C2=A0 If it does anything at all when not quoted, I'm unaware of it= , but I admit that I could just be ignorant of some subtlety.

=
=

ddd=3D( "${(= @f)aaa}" )


Now you're = keeping the blank lines, so the (f) gives you a separate array element for = every line that you get from the expansion - 8 of them, the same as the out= put of=C2=A0print -l $aaa | wc= -l.
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=C2= =A0

redline '\nddd=3D( "${(@f)aaa= }" ) ... it seems like a lot of trouble to copy the array as it is.= 9;


Th= at comment confuses me; you aren't copying the array as it is at all! Y= ou've gone from aaa, which has one element, to ddd=C2=A0h= aving 8 elements. That's a far cry from "copying as it is".

Your next comment says "8 not 6". I assum= e the expected 6 would be the middle lines, without the leading and trailin= g blank ones, but I know of no expansion that will produce that.=C2=A0You c= an get 6 elements out of aaa, like this:

<= blockquote style=3D"margin:0 0 0 40px;border:none;padding:0px">
eee=3D( $=3Daaa )
But it gets there by throwing away all space, including n= ewlines.=C2=A0 So the six elements will be simply "abc", "de= f", "ghi", "jkl", "mno", and "pqr&q= uot;


On Sat, Apr 13, 2024 at 11:14=E2=80=AFAM Ray= Andrews <rayandrews@eastlink.= ca> wrote:
I dunno.  I've lost the example that I saved. Never mind, I&=
#39;ll keep an eye on it, and figure out next time. Red herring for now.  I=
t's a bit confusing looking into typeset -p output. All this 'split=
ting' stuff is not simple. For now everything works and I'm quite s=
ure it's a bit more orthodox.

  =20
A script:
---------------------------------------------------------------------------= ------

redline () { echo -e "$red$@$nrm" }

typeset -ga aaa=3D("
abc

=C2=A0=C2=A0 =C2=A0def ghi
=C2=A0=C2=A0 =C2=A0jkl mno

=C2=A0=C2=A0 =C2=A0pqr
")

redline "\naaa:"
print -l $aaa
redline "\naaa[1]:"
print -l $aaa[1]
redline "linecount of aaa is: $#aaa ... Single element!"

ccc=3D( ${(@f)aaa} )

redline '\nccc=3D( ${(@f)aaa} )'
print -l $ccc
redline "linecount of ccc is: $#ccc ... split, but blank lines gone."

ddd=3D( "${(@f)aaa}" )

redline '\nddd=3D( "${(@f)aaa}" ) ... it seems like a lot= of trouble to copy the array as it is.'
print -l "$ddd[@]"=C2=A0 #... don't forget the quotes, id= iot!"
redline "linecount of ddd is: $#ddd ... split, but blanks preserve= d and counted. NB EIGHT NOT SIX!"

redline "\nddd[1]: That's right it's blank, just as it sho= uld be."
print -l $ddd[1]
redline "\nddd[2]:"
print -l $ddd[2]

redline "And now the typesets\n"
typeset -p aaa
typeset -p ccc
typeset -p ddd

# Verbatim:

# typeset -a aaa=3D( $'\nabc\n\n\tdef ghi\n\tjkl mno\n\n\tpqr\n'= ; )
# typeset -a ccc=3D( abc $'\tdef ghi' $'\tjkl mno' $= 9;\tpqr' )
# typeset -a ddd=3D( '' abc '' $'\tdef ghi' $&#= 39;\tjkl mno' '' $'\tpqr' '' )

# Aligned: Note the steeenking dollars ;-) ... and how they seem to replace the newlines. No?

# typeset -a aaa=3D( $'\nabc=C2=A0 \n\n\tdef ghi=C2=A0 \n\tjkl mno= =C2=A0=C2=A0 \n\n\tpqr\n' )=C2=A0=C2=A0=C2=A0=C2=A0 #Original with blanks
# typeset -a ccc=3D(=C2=A0=C2=A0=C2=A0=C2=A0 abc=C2=A0=C2=A0=C2=A0 $= 9;\tdef ghi' $'\tjkl mno=C2=A0=C2=A0 ' $'\tpqr' )=C2=A0 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 #No blanks. # typeset -a ddd=3D(=C2=A0 '' abc '' $'\tdef ghi= 9; $'\tjkl mno' '' $'\tpqr' '' )=C2=A0=C2=A0=C2=A0 #Blanks retained BUT not the same struct= ure!

---------------------------------------------------------------------------= --------

... so what about the dollars?

Anyway, it comes clear: '${(@f)....}' doesn't ADD (or retai= n) newlines it removes them!=C2=A0 (Tho splitting the array where they use= d to be.) Doesn't need them cuz elements aren't separated by newl= ines (like I thought) but by ... however it's done.=C2=A0 Single quotes indicate elements.=C2=A0 And, best of all, copying an array, blanks and all, (not shown above) turns out to be simple:

eee=3D( $aaa ) and:

eee=3D( "{$(@f)aaa}" )

... turns out to be a false equivalence where newlines are REMOVED.=C2= =A0 Don't be fooled by 'printf' -- it might not show you the ge= nuine state of the array.=C2=A0 Scalars show their blank lines automatically but we need:

print -l -- "$eee[@]"

... with arrays.=C2=A0 Trust typedef -p.




--
Ma= rk J. Reed <mar= kjreed@gmail.com>
--000000000000e0c6b60615fd9809--