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

Avoiding empty element when splitting NUL-separated string from command substitution



% b=(${(0)"$(print -n)"})
% echo $#b
1

How do I avoid b containing an empty element in this case?  That is,
when the command substitution generated no output.

(The $(print -n) is, obviously, just an example.  It can be the
equivalent of, for example, $(print -n $'a\0\b\0c) as well.)



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