zsh-users
 help / color / mirror / code / Atom feed
* Printing empty array elements
@ 2018-10-31  8:19 Jesper Nygårds
  2018-10-31  8:31 ` Jesper Nygårds
  0 siblings, 1 reply; 4+ messages in thread
From: Jesper Nygårds @ 2018-10-31  8:19 UTC (permalink / raw)
  To: Zsh Users

[-- Attachment #1: Type: text/plain, Size: 382 bytes --]

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?

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-10-31 10:30 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-31  8:19 Printing empty array elements Jesper Nygårds
2018-10-31  8:31 ` Jesper Nygårds
2018-10-31 10:00   ` Mikael Magnusson
2018-10-31 10:29     ` Jesper Nygårds

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).