zsh-users
 help / color / mirror / code / Atom feed
* Avoiding empty element when splitting NUL-separated string from command substitution
@ 2011-08-16 12:13 Nikolai Weibull
  2011-08-16 12:51 ` Peter Stephenson
  0 siblings, 1 reply; 4+ messages in thread
From: Nikolai Weibull @ 2011-08-16 12:13 UTC (permalink / raw)
  To: Zsh Users

% 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.)


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

end of thread, other threads:[~2011-08-16 15:37 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-08-16 12:13 Avoiding empty element when splitting NUL-separated string from command substitution Nikolai Weibull
2011-08-16 12:51 ` Peter Stephenson
2011-08-16 14:06   ` Nikolai Weibull
2011-08-16 14:53   ` Peter Stephenson

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).