Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: [PATCH] vared: Escape empty elements of arrays
- X-seq: zsh-workers 45878
- From: Oliver Kiddle <okiddle@xxxxxxxxxxx>
- To: Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx>
- Subject: Re: [PATCH] vared: Escape empty elements of arrays
- Date: Thu, 21 May 2020 12:57:24 +0200
- Cc: zsh-workers@xxxxxxx
- In-reply-to: <20200521070539.46a6e9de@tarpaulin.shahaf.local2>
- 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>
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.
Oliver
Messages sorted by:
Reverse Date,
Date,
Thread,
Author