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

Re: [PATCH] vared: Escape empty elements of arrays



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