From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28397 invoked from network); 26 Nov 2006 18:40:19 -0000 X-Spam-Checker-Version: SpamAssassin 3.1.7 (2006-10-05) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00, FORGED_RCVD_HELO autolearn=ham version=3.1.7 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 26 Nov 2006 18:40:19 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 8883 invoked from network); 26 Nov 2006 18:40:11 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 26 Nov 2006 18:40:11 -0000 Received: (qmail 14124 invoked by alias); 26 Nov 2006 18:13:18 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 11039 Received: (qmail 14114 invoked from network); 26 Nov 2006 18:13:17 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 26 Nov 2006 18:13:17 -0000 Received: (qmail 77407 invoked from network); 26 Nov 2006 18:13:17 -0000 Received: from vms044pub.verizon.net (206.46.252.44) by a.mx.sunsite.dk with SMTP; 26 Nov 2006 18:13:13 -0000 Received: from torch.brasslantern.com ([71.116.86.88]) by vms044.mailsrvcs.net (Sun Java System Messaging Server 6.2-6.01 (built Apr 3 2006)) with ESMTPA id <0J9C002JQNXFRF3L@vms044.mailsrvcs.net> for zsh-users@sunsite.dk; Sun, 26 Nov 2006 12:12:52 -0600 (CST) Received: from torch.brasslantern.com (localhost.localdomain [127.0.0.1]) by torch.brasslantern.com (8.13.1/8.13.1) with ESMTP id kAQICor7025810 for ; Sun, 26 Nov 2006 10:12:51 -0800 Received: (from schaefer@localhost) by torch.brasslantern.com (8.13.1/8.13.1/Submit) id kAQIComw025809 for zsh-users@sunsite.dk; Sun, 26 Nov 2006 10:12:50 -0800 Date: Sun, 26 Nov 2006 10:12:50 -0800 From: Bart Schaefer Subject: Re: array not working In-reply-to: To: zsh-users@sunsite.dk Message-id: <061126101250.ZM25808@torch.brasslantern.com> MIME-version: 1.0 X-Mailer: OpenZMail Classic (0.9.2 24April2005) Content-type: text/plain; charset=us-ascii References: Comments: In reply to zzapper "Re: array not working" (Nov 26, 12:53pm) On Nov 26, 12:53pm, zzapper wrote: } Subject: Re: array not working } } zzapper wrote in } news:Xns98877CBF8A380zzappergmailcom@80.91.229.5: } } > Hi a previously working zsh script Are you running this stand-alone or is it loaded as a shell function? Did you update any any other part of Cygwin recently? } > someurl=(database login password filename) } > } > "$mysqldump" $param -h $server -u${someurl[1]} -p$someurl[2] -B } > ${someurl [0]} > ${someurl[3]}.sql I'm going to assume the space before [0] is a line wrapping artifact. } > What is happening is that ${someurl[1]} $someurl[2] ${someurl[0]} } > are all evaulating to the same value (first element in array) Quite frankly I'm not sure how this ever worked. With the ksh_arrays option NOT set, ${someurl[1]} and ${someurl[0]} should always have been the same value, and WITH ksh_arrays set, $someurl[2] is the same as ${someurl}[2] which would be interpreted as a file pattern (and either error with "no match" or result in one of "database[2]" or nothing, depending on the nomatch and nullglob options). There is no case I know of where [[ ${someurl[1]} == $someurl[2] ]] would be true, given the shown starting state of the array. } > what daft thing am i doing? I can't think of any combination of setopts that would produce your desired effect with that assortment of subscripting and braces. } Started new shell and problem went away, but arrays now seem to be } indexed from 1 rather than zero?? } } Did this change recently? As Nikolai said, no, it did not. Aside from the impossible scripting above, could it be that someone has changed something in a startup file? Perhaps in the Cygwin equivalent of /etc/zshenv or similar?