Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
set -o nounset; foo=(); print ${foo:#bar}
- X-seq: zsh-users 19055
- From: Roman Neuhauser <neuhauser@xxxxxxxxxx>
- To: zsh-users@xxxxxxx
- Subject: set -o nounset; foo=(); print ${foo:#bar}
- Date: Sat, 6 Sep 2014 20:47:49 +0200
- 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 encountered a behavior i don't like and would like to get rid of. :)
roman@wrench ~ 0 1074 0 > print $ZSH_VERSION
5.0.5
roman@wrench ~ 0 1075 0 > set -o nounset
roman@wrench ~ 0 1076 0 > foo=()
roman@wrench ~ 0 1077 0 > print $foo
roman@wrench ~ 0 1078 0 > print ${foo:#bar}
zsh: foo: parameter not set
roman@wrench ~ 0 1079 1 >
the problematic part is ${foo:#bar} triggering nounset. FMPOV it *is*
set (but null), so i'd say the observed behavior is a bug.
is it fixable? or is there at least a good workaround? (stuffing the
array with a sentry is not a good workaround.)
--
roman
Messages sorted by:
Reverse Date,
Date,
Thread,
Author