Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: [PATCH] vared: Escape empty elements of arrays
- X-seq: zsh-workers 45886
- From: Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: Re: [PATCH] vared: Escape empty elements of arrays
- Date: Thu, 21 May 2020 16:32:34 +0000
- In-reply-to: <52503-1590058644.696341@0c4k.-v5l.VV1->
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- List-unsubscribe: <mailto:zsh-workers-unsubscribe@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <20200519235425.13713-1-danielsh@tarpaulin.shahaf.local2> <20200521070539.46a6e9de@tarpaulin.shahaf.local2> <52503-1590058644.696341@0c4k.-v5l.VV1->
Oliver Kiddle wrote on Thu, 21 May 2020 12:57 +0200:
> Daniel Shahaf wrote:
> > — it seems to be impossible for the result of a vared operation to
> > include empty elements. In particular, editing an array with empty
> > elements in master silently drops them. With the patch, the elements
> > would become «''» (two bytes).
>
> For editing arrays, I typically use the following:
>
> alias lvared="IFS=\$'\n\n' vared"
>
> That preserves empty elements from blank lines.
Thanks! I'll see if I can add this to the manual as a tip. And maybe
emit a warning if an array is edited that has empty elements.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author