Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Printing empty array elements
- X-seq: zsh-users 23737
- From: Jesper Nygårds <jesper.nygards@xxxxxxxxx>
- To: Zsh Users <zsh-users@xxxxxxx>
- Subject: Printing empty array elements
- Date: Wed, 31 Oct 2018 09:19:30 +0100
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=oj90gAfBT/Jl6E0AtqrXD+sOEwoEJ6agqCSTDzU9IIc=; b=funzSX8sdIjfEKa1N5me9HobzkEF0x+UUEr1gzkb82xdj1qyMDog2HjrmE4n2StNxN 0tHluAXYrFeSVKZ2325YLaWRAXCqofk2KAGFiFtc3kRJq3gVud8U1S2gMkk319c1NQBB lsaoiCCZpi7lfQLaWo4f9B17YJicdIWGVouztL9UeFGmpXjO/n5kacePW7iLiIlXA4wC CeD1lbEvE7xIjWz9QHyzYjr5N61GVSUIKIJcgzWLYufYCPKGzHeL9LoO/tujWJZ4Bs6Z T/pfXACOKKvvHMEHuNPyA8W0KfHlOzl+4xwNmlUfcvx9vAssGwNlgOjBQzpES+GlAJxo ncAw==
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- List-unsubscribe: <mailto:zsh-users-unsubscribe@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
Consider the following:
% rlines=("${(@f)$(print a; print; print c)}")
% for (( i=1; $i<=$#rlines; i+=1 )); do print $rlines[$i]; done
a
c
% print -l $rlines
a
c
In other words, "print -l" doesn't print empty array elements (or perhaps
it never even sees them?). Is there a way to make it not omit empty
elements when printing an array, apart from iterating over the elements?
Messages sorted by:
Reverse Date,
Date,
Thread,
Author