From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24238 invoked by alias); 29 Oct 2015 17:28:18 -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: 20857 Received: (qmail 15321 invoked from network); 29 Oct 2015 17:28:17 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.0 X-AuditID: cbfec7f5-f794b6d000001495-bc-5632572d0d38 Date: Thu, 29 Oct 2015 17:28:10 +0000 From: Peter Stephenson To: "" Subject: Re: Associative array, brace-free subscripting: key with spaces Message-id: <20151029172810.1f326658@pwslap01u.europe.root.pri> In-reply-to: References: Organization: Samsung Cambridge Solution Centre X-Mailer: Claws Mail 3.7.9 (GTK+ 2.22.0; i386-redhat-linux-gnu) MIME-version: 1.0 Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7bit X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrELMWRmVeSWpSXmKPExsVy+t/xa7q64UZhBtPP6lvsOLmS0YHRY9XB D0wBjFFcNimpOZllqUX6dglcGe9WTGUumMxc8f7XHKYGxkVMXYwcHBICJhJHf6V2MXICmWIS F+6tZ+ti5OIQEljKKHH1eSsjhDONSWLz7pcsEM42Rom+4zNYQVpYBFQlPvz9yAxiswkYSkzd NJsRZKqIgK7EjVXyIGFhAQ+J3Y1tYCW8AvYSD7d/BGvlFAiW2LzzDCOILSQQILF/zX52EJtf QF/i6t9PTBAX2UvMvAJRwysgKPFj8j0WEJtZQEti87YmVghbXmLzmrfMEHPUJW7c3c0+gVFo FpKWWUhaZiFpWcDIvIpRNLU0uaA4KT3XSK84Mbe4NC9dLzk/dxMjJGS/7mBceszqEKMAB6MS D+/KFsMwIdbEsuLK3EOMEhzMSiK8S+2NwoR4UxIrq1KL8uOLSnNSiw8xSnOwKInzztz1PkRI ID2xJDU7NbUgtQgmy8TBKdXAGL/x3OHjVT3P1+m9uNOQ21w0TbayNH7uqRCVvfrHvswo/Zj5 49eRFbPebFih/et0zDR517+229Z/vuhjEBJ5IfBbdrhH9QdVnhdciwyymy4vPWSUG8t14lGI kqFrwZ9pb0uDq98VM23jP9b0L0zvC3d7yZOQSy+unlgvw/xB99/C82V5v6JrTyixFGckGmox FxUnAgD90/DcVQIAAA== On Thu, 29 Oct 2015 13:17:17 -0400 Clint Hepner wrote: > Consider the array > > typeset -A b > b=("a b c" d) > > The following correctly expands to "d" > > ${b[a b c]} > > but this results in a "bad subscript" error: > > $b[a b c] Without the surrounding brace, the spaces separate words, so it looks at "$b[a" and doesn't like it. pws