Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: mysterious newline
- X-seq: zsh-users 30767
- From: Ray Andrews <rayandrews@xxxxxxxxxxx>
- To: zsh-users@xxxxxxx
- Subject: Re: mysterious newline
- Date: Fri, 20 Nov 2026 06:04:53 -0700
- Archived-at: <https://zsh.org/users/30767>
- In-reply-to: <CAA=-s3w2AahZH8BcA7eFaN7_1oxzyEV5Vp-W_DmCoqzwL1vSLQ@mail.gmail.com>
- List-id: <zsh-users.zsh.org>
- References: <0fad2590-65a7-4634-b8b8-97c734a03a01@eastlink.ca> <CAA=-s3w2AahZH8BcA7eFaN7_1oxzyEV5Vp-W_DmCoqzwL1vSLQ@mail.gmail.com>
On 2026-11-19 20:59, Mark J. Reed
wrote:
That code doesn't append any
newlines. It builds an array of lines. All the final2+=" " code
does is insert an entry into the array that's nothing but a
space. The space isn't needed; it could just be the empty
string.
Always the ghost of C haunts the mansion. Even when I'm right I'm
subtly wrong. Yes, empty element is the way to think about it.
Tx.
The default separator for those [w]ords is $IFS so $var[(w)1]
is similar to ${${=var}[1]}.
Gotta learn these 'subscript flags'. Half the battle is knowing what various syntactic elements are even called. Googling for '(w)' isn't helpful. AI is getting useful tho, it says that 'substring qualifier' is correct, but I expect that 'subscript flag' is just as good.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author