From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14349 invoked by alias); 11 May 2015 05:02:52 -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: 20198 Received: (qmail 25051 invoked from network); 11 May 2015 05:02:51 -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.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.2 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:message-id:date:in-reply-to:comments :references:to:subject:mime-version:content-type; bh=E5WTQrMULHZ1nano0YY0ViuqSPY8iLMbC0cwUjLf5Do=; b=ZKAE95I0Aswf8hi4QkDYoKpLfXZdpcDJUXSbfsmv6/iIwAaVq/sHWCGfkbTtwRL+Ng t35JVD6nm+n0vGo/4Oy35Z/fRvLSc5rOBwFiepvB7Fqp3PkOaFou59fjmF835h065ccB XZEktELnxA0zainHYY7bZaenpxzfPmYK8+57jL+KM95FPH06uv4Ay3SEWQcIerE9KyBw Cvbm82JLedwu4aR3mSV6kCoevinaIZPGICeiXXJSUydCgoROIek75k5HuU3fVTp8MWPl WBZ1BcfSUP6FXn6C9A49FOt7FmLxc99jfRJEvcSMWUppBfQhDaihCigfTraeQfqw1RZf Qucg== X-Gm-Message-State: ALoCoQnG8man7ixO61OwfAUiQtdo4wlq/V2tUSLjS+GaSfhQogWGiaqlD0WPGfcmPK7Ao10Y9Nuu X-Received: by 10.202.229.139 with SMTP id c133mr6324062oih.99.1431320569833; Sun, 10 May 2015 22:02:49 -0700 (PDT) From: Bart Schaefer Message-Id: <150510220246.ZM10136@torch.brasslantern.com> Date: Sun, 10 May 2015 22:02:46 -0700 In-Reply-To: <67F1153E-5D3C-4D29-BDD0-1BB9C71FF55A@gmail.com> Comments: In reply to Kannan Varadhan "new user questions and issues" (May 6, 10:37am) References: <67F1153E-5D3C-4D29-BDD0-1BB9C71FF55A@gmail.com> X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: zsh-users@zsh.org, zsh-users@zsh.org Subject: Re: new user questions and issues MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Most of this has been answered already, throwing one extra remark. On May 6, 10:37am, Kannan Varadhan wrote: } } Issue #2. Overridden local variables get echoed? The tidbit that no one has explicitly mentioned is that "local" et al. has function scope, so it makes no sense to declare something "local" inside a loop body. (In an if/else, it could make sense, as long as the if/else is not itself inside a loop, but the variables declared there will persist beyond the "fi".) If you for some reason need a declaration to be local to a loop, use an anonymous function context like this: local _t2 for _t2 in 0 1 2 ; do function { local _t3 _t3=XXX__${_t2}__ } done