From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17023 invoked by alias); 4 Feb 2015 01:30:41 -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: 19804 Received: (qmail 26310 invoked from network); 4 Feb 2015 01:30:28 -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=-2.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.2 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=larryv.me; h= x-sasl-enc:content-type:mime-version:subject:from:in-reply-to :date:cc:content-transfer-encoding:message-id:references:to; s= mesmtp; bh=kyK/B3R/MvD5/w+2v0GZzsyUbY4=; b=ljZtiiWa+zYV2ixO4Ng7V +nGCTMFNLlhardplU0JmilPUwyXopX5uQtZ4zvwmSw6wDn+iNKn1Ud5Sx463aqE/ i11m+4OFgRrAfo4GsW1KGonTA9/5OswNqPDuLP/i8ELbIjMw4eiy/WZyO2f/Swuu wYzKlBhSDRz1TFW6Cw8UZU= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=x-sasl-enc:content-type:mime-version :subject:from:in-reply-to:date:cc:content-transfer-encoding :message-id:references:to; s=smtpout; bh=kyK/B3R/MvD5/w+2v0GZzsy UbY4=; b=eTMlls3JDsghXowyK89+yl7th6vFjJhOwiadQTSRrben55ME8cfJShh bvfDv+uSkMgszkWoSrUD2N0nmP6z/gZa6TCSDIeJpSMA5I4lGbG2ULwnMg+ybKNS isXM95aiaaNFeOVFbQJfFjQxNneDzVpSJILa34IrUdn6e0LPz3Jo= X-Sasl-enc: TNFqp006KCOdxqDbFwNlJJ7nVeRn406fI+SK3i1HKKYg 1423013426 Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2070.6\)) Subject: Re: ${var:1:1:=y} From: =?utf-8?Q?Lawrence_Vel=C3=A1zquez?= In-Reply-To: <54D16A4C.9010609@eastlink.ca> Date: Tue, 3 Feb 2015 20:30:26 -0500 Cc: zsh-users@zsh.org Content-Transfer-Encoding: quoted-printable Message-Id: References: <54D155C8.4080600@eastlink.ca> <412544FB-49A2-43AA-BC76-DC1AF1AA71BE@larryv.me> <54D16A4C.9010609@eastlink.ca> To: Ray Andrews X-Mailer: Apple Mail (2.2070.6) On Feb 3, 2015, at 7:39 PM, Ray Andrews wrote: > I'd naively read it: assign to 'variable' either the value of the = second character of 'var' (just one character), and if that does not = exist, assign 'y'. See, that interpretation didn't occur to me at all :) =46rom zshexpn(1): If a ${...} type parameter expression or a $(...) type command substitution is used in place of "name" above, it is expanded first and the result is used as if it were the value of "name". So you'd probably want something like this, except with variable assignment instead of `echo`: % foo=3D % echo ${${foo:1:1}:-y} y % foo=3Da % echo ${${foo:1:1}:-y} y % foo=3Dabcdef % echo ${${foo:1:1}:-y} b % vq=