Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
print entire array *with* subscript?
- X-seq: zsh-users 9896
- From: Jean-Rene David <jrdavid@xxxxxxxx>
- To: zsh-users@xxxxxxxxxx
- Subject: print entire array *with* subscript?
- Date: Thu, 9 Feb 2006 14:40:41 -0500
- Mail-followup-to: zsh-users@xxxxxxxxxx
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
The (k) expansion flag for associative arrays
substitutes the keys of the array instead of the
values.
But when applied to a normal array, it does
nothing. I thought it would have printed the
values' indices. It seems like an intuitive thing
to do. I thought that's what was meant in the
documentation:
13.3.1 Parameter Expansion Flags
[...]
k
[...] Used with subscripts (including
ordinary arrays), force indices or keys to be
substituted even if the subscript form refers to
values. [...]
Either I misunderstand, or it's not doing what it
says. I lean towards the former. Can someone shed
light?
$ zsh --version
zsh 4.2.5 (i686-pc-linux-gnu)
--
JR
Messages sorted by:
Reverse Date,
Date,
Thread,
Author