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

zsh array subscripting with ksh comp behaviour



Hi,

My company gives us our default zsh in ksh compatibility mode.

I don't really like working this way so when I get a new shell I usually
just type zsh and load up my favourite options

I have noticed something strange, it is easy to solve but should this
really be default behaviour, I thought I'd report it.

] arr=(one two three)
] echo ${arr[0]}
one
] echo ${arr[1]}
one
] echo ${arr[2]}
two
] echo ${arr[3]}
three

setopt ksharrays

] echo ${arr[0]}
one
] echo ${arr[1]}
two
] echo ${arr[2]}
three
] echo ${arr[3]}

Regards,

Jerry Rocteur


Messages sorted by: Reverse Date, Date, Thread, Author