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

Re: Shell variable tables:setting value for elemet 1 overwrites element 0



wojciech.szenajch@xxxxxxxxxxx wrote:
> $ zsh --version
> zsh 4.2.0 (i386-suse-linux)    or zsh 4.2.0 (i386-redhat-linux-gnu)
> $ zsh
> $ TB[0]=zero
> $ echo ${TB[0]}
> zero     <-------------------------------- correct result
> $ TB[1]=one
> $ echo ${TB[0]}
> one     <-------------------------------- incorrect result
> $ echo ${TB[1]}
> one

This is correct.  "setopt ksh_arrays" or start up under the alias sh
or ksh to get the other behaviour.

-- 
Peter Stephenson <pws@xxxxxxx>                  Software Engineer
CSR PLC, Churchill House, Cambridge Business Park, Cowley Road
Cambridge, CB4 0WZ, UK                          Tel: +44 (0)1223 692070


**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.

**********************************************************************



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