From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3937 invoked by alias); 21 Aug 2014 19:47:45 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 19030 Received: (qmail 7610 invoked from network); 21 Aug 2014 19:47:33 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,HTML_MESSAGE, RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.2 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:content-type; bh=zruBjl7bhRwokff0NGqAcJDpXV40+8iIgTZa+KLmTfo=; b=MGABacuDtFfyRjILnNK23DPvGwQikZyH025L28nOUJOJnY9UuIf187Ene+8wYScLLF EHeJlHS3gImcbiSp5ngW4e1wRbpJ60YQWwBhQdLi30/gW0m2IxvPWVo6Px8mjENu5Wo3 UcgO9VhzKBVhXuUTvcJUNqH0bnCGx23qwlyTZOcp1y91s+d8chtCdQSjHKnGeaq11ZU6 2WVVawSBvYCBrKhVimvhH50d/bRJno2sX4Ufqb2RJzXkP2RXgOwPiQ/jXMgQNTWvYhdA ZuYM17usuK8jHm6X/aLvnofJ0IeA8kW8KDARGPJ7lm3ggVOJjMsbpaqtMZzXhw76Ur0n NAVA== X-Gm-Message-State: ALoCoQluUIWc/zhWIN1pLgCfNACBIClxWqJ8zEHf5Yia4R0nOGkurBkQOn5gvbPfTr+QvzqaRWgE MIME-Version: 1.0 X-Received: by 10.112.225.7 with SMTP id rg7mr609335lbc.52.1408650448959; Thu, 21 Aug 2014 12:47:28 -0700 (PDT) In-Reply-To: References: Date: Thu, 21 Aug 2014 12:47:28 -0700 Message-ID: Subject: Re: zsh array subscripting with ksh comp behaviour From: Bart Schaefer To: Zsh Users , jerry.rocteur@gmail.com Content-Type: multipart/alternative; boundary=001a11348d4e9f8f8a050128fdb6 --001a11348d4e9f8f8a050128fdb6 Content-Type: text/plain; charset=UTF-8 On Aug 21, 2014 6:57 AM, "Jerry Rocteur" wrote: > > 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 Is the behavior you find strange (a) that ${arr[0]} is "one" or (b) that ${arr[1]} is not "two"? If (a) you may be happy to hear that this has been changed in more recent zsh releases, so that (without ksharrays set) ${arr [0]} is the empty string, as with any other index that is outside the array bounds. If (b) then this has already been explained as zsh's normal 1-based indexing (again, without ksharrays). --001a11348d4e9f8f8a050128fdb6--