From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16213 invoked by alias); 9 Jan 2013 09:46:58 -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: 17544 Received: (qmail 5643 invoked from network); 9 Jan 2013 09:46:45 -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=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.2 Received-SPF: none (ns1.primenet.com.au: domain at linux.vnet.ibm.com does not designate permitted sender hosts) Date: Wed, 9 Jan 2013 17:35:53 +0800 From: Han Pingtian To: zsh-users@zsh.org Subject: Re: array matching: inconsistent behaviour ? Message-ID: <20130109093553.GI2054@localhost.localdomain> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-Content-Scanned: Fidelis XPS MAILER x-cbid: 13010909-2876-0000-0000-000003E4F8BD On Wed, Jan 09, 2013 at 12:00:34PM +0530, rahul wrote: > Or am I doing the matching wrong? I am storing file names in an array. > Later I match filenames against those in the array for various purposes. > The filenames contain spaces and in this unfortunate case round brackets. > File names with brackets are failing the match. > > FOO=() > x="a file" > y="a(file)b" > > FOO+=($x) > FOO+=($y) > > print $FOO[(i)$x] > print $FOO[(i)$y] > Looks like if using "e" flag, both would be matched here.