Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Avoiding empty element when splitting NUL-separated string from command substitution
- X-seq: zsh-users 16252
- From: Nikolai Weibull <now@xxxxxxxx>
- To: Zsh Users <zsh-users@xxxxxxx>
- Subject: Avoiding empty element when splitting NUL-separated string from command substitution
- Date: Tue, 16 Aug 2011 14:13:58 +0200
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:date:x-google-sender-auth:message-id:subject :from:to:content-type; bh=vSE0F6AT42jSd+9uG3i6k3OtJvnCbg6KAwoyKV9K4lE=; b=NDPpqusRvP+n5BrcTu1aLLU751xwcII+MYgeX+xOms0RLChuhD5BtiyozT+qwkX0ol ZHTdN/E35zqn3RQLySVpY/W2rPX1qUUe8IMOFiIqBl1AvXMM8T64iihljvexssM4FLzM T5/rNWomIWsM8M/vTJJvlbBN2nqgu1+fq6AWI=
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- Sender: nikolai.weibull@xxxxxxxxx
% 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