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

Printing empty array elements



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