From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28443 invoked by alias); 26 Sep 2015 18:57: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: 20650 Received: (qmail 24438 invoked from network); 26 Sep 2015 18:57:16 -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, 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=date:from:to:subject:message-id:mail-followup-to:references :mime-version:content-type:content-disposition:in-reply-to :user-agent; bh=CCJVtEtpwLqq5djaTdupN0i4xAuWzCcBmnii4VYpopg=; b=vn7zBhgxBziNeNxMleP9Pv1cVmowh+jPdFTrvqBnXX6/OXGNiFECKxONvjK1R8eXT8 xy1bKO9bD5VnocOgVkrUcWIICPxTO8R1cTwwTqaFBMByW6B3Grm8Wk23JS2siCcIHOtj qR5H7f8+93aU4EFB/Qxxr/d72KjwNeLmF7bKC6H12ztr2o2tFx6CZsCe0u/6bJ5QN8S2 JP1ovJxv9Sd4eRal8Gmc6bdWLLA72v64PZ0my9Y5y+uH2lBowCza9gQkBgJFKcYzDr+j 1URegRvGjyAIm3w9O1ehpygqUZe8AAw655sRmTTlhpcQ07UQdyIP+OK4oKHOa2SPSO3R ffmw== X-Received: by 10.152.4.103 with SMTP id j7mr3324002laj.92.1443293833529; Sat, 26 Sep 2015 11:57:13 -0700 (PDT) Date: Sat, 26 Sep 2015 21:57:10 +0300 From: Dmitri Vereshchagin To: zsh-users@zsh.org Subject: Re: question about parameter expansion Message-ID: <20150926185710.GA3981@gmail.com> Mail-Followup-To: zsh-users@zsh.org References: <20150926101839.GA14021@gmail.com> <20150926180827.GA2617@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) * Mikael Magnusson [2015-09-26 21:34]: > Here's another variant, which may or may not be considered more > concise (it happens to be the exact same number of characters, but > uses fewer things, and probably doesn't work under ksh_arrays, but > then, what does, commas abounds), > > bar=${${:-baz}[1,$+foo-1]} Nice. Seems like there is another alternative bar=${${foo-baz}#$foo} -- Dmitri Vereshchagin