From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21617 invoked by alias); 28 Jul 2014 00:39:16 -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: 18992 Received: (qmail 11007 invoked from network); 28 Jul 2014 00:39:14 -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=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 From: Bart Schaefer Message-id: <140727173904.ZM18201@torch.brasslantern.com> Date: Sun, 27 Jul 2014 17:39:04 -0700 In-reply-to: Comments: In reply to Rory Mulvaney "brace expansion in array subscript" (Jul 27, 2:57pm) References: X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: Zsh Users Subject: Re: brace expansion in array subscript MIME-version: 1.0 Content-type: text/plain; charset=us-ascii On Jul 27, 2:57pm, Rory Mulvaney wrote: } } echo ${arr[{2,5}]} } } Why doesn't that get expanded into "echo ${arr[2]} ${arr[5]}"? Array subscripts are already a comma-separated pair of arithmetic expressions (or a quoted string value for associative arrays), and curly braces already have their own special meaning in parameter expansion expressions. The syntax for brace expansion doesn't fit well here. } It seems there would be lots of convenient uses of this feature. If you really need it, you can get it this way: echo ${(e):-\${arr[{2,5}]}}