From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15024 invoked by alias); 29 Oct 2015 17:17:21 -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: 20855 Received: (qmail 7166 invoked from network); 29 Oct 2015 17:17:20 -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,FREEMAIL_FROM, HTML_MESSAGE,T_DKIM_INVALID autolearn=ham autolearn_force=no version=3.4.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=21X6VYbSg4fLMpYAAavdonwj4MMqSZCOiOguNt0wZ5c=; b=x9ym2sPPvaC6Ioy5CiJzQ3Xuu3jPmzs5E3auUl4XcT8LJyHL2DUry6MkmmcvRFiJcA tlKe/I18TWXNfts78pZC4+hhggwNYvn78tkKfLGlHujC7RPJRvt2hAT0wFhjbsxDtBW6 KFquxMtWqFzDbTEyYfLUAqSrnFn9TFKtexgTQC/IGI3KVFU5Yrd4GEG8ZZwaYxDseW67 puZqGgTmuy3GejwUE5PRLaCtF4HnS9HvqzUidWwbk8dIUkzImkbfu49fPpP88+Fj4SHJ 9SxUFwIUfgKjegRAXXy/TC+TYToKSNUPYRE+zlMONPjvDLVWzb/IulF2ETwwf3YOGM+P 1kfw== MIME-Version: 1.0 X-Received: by 10.31.183.77 with SMTP id h74mr2054287vkf.43.1446139037543; Thu, 29 Oct 2015 10:17:17 -0700 (PDT) Date: Thu, 29 Oct 2015 13:17:17 -0400 Message-ID: Subject: Associative array, brace-free subscripting: key with spaces From: Clint Hepner To: "" Content-Type: multipart/alternative; boundary=001a11439d64a0f0d50523417b8b --001a11439d64a0f0d50523417b8b Content-Type: text/plain; charset=UTF-8 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] I can't seem to find anything in the man page about why this would be the case. It seems to be a parsing error, since using a separate parameter to store the key works fine as well: z="a b c" print $b[$z] -- Clint Hepner clint.hepner@gmail.com --001a11439d64a0f0d50523417b8b--