Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

print entire array *with* subscript?



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