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

How to substitute empty array element, or empty string



Hello,
following does not work as expected:

% a=( a "" c ); print -rl -- "${(@)a//*/x}”
x

x

% a=""; print -rl -- "${a//*/x}”
(empty line)

I guess this is inherited from // substitution. I count lines using substitution that matches (*), and it is skipping empty lines, giving wrong line number for following elements.

Is there any solution? I’ve tried (#s), (#s)(#e), *(#e) and nothing.

--
Sebastian Gniazdowski
psprint@xxxxxxxxxxx



Messages sorted by: Reverse Date, Date, Thread, Author