Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
shwordsplit and ksharrays will change rcexpandparam's behavior on empty array
- X-seq: zsh-users 17264
- From: Han Pingtian <hanpt@xxxxxxxxxxxxxxxxxx>
- To: zsh-users@xxxxxxx
- Subject: shwordsplit and ksharrays will change rcexpandparam's behavior on empty array
- Date: Thu, 13 Sep 2012 21:05:50 +0800
- 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
Hello,
I noticed that 'shwordsplit' will change the behavior of 'rcexpandparam'
on empty array:
% zsh -c 'xx=(); print foo${^xx}bar'
<empty>
% zsh -c 'setopt shwordsplit;xx=(); print foo${^xx}bar'
foobar
Not sure if this is a bug.
And looks like 'ksharrays' can do this, too:
% zsh -c 'setopt ksharrays;xx=(); print foo${^xx}bar'
foobar
Maybe ksharrays lets the $xx evluated as a scalar, a null string, so
foo${^xx}bar is return as foobar?
Thanks.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author