From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2473 invoked by alias); 2 Nov 2014 22:57:38 -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: 19314 Received: (qmail 2287 invoked from network); 2 Nov 2014 22:57:25 -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,HTML_MESSAGE, 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:mime-version:in-reply-to:references:date :message-id:subject:from:to:content-type; bh=E+UoKgut/r9nk7xa8E82pxxdoinX+heytgMJOOcNU+8=; b=CRjIJpm3RujHGZGHTZzBnFbb1HhmvaTzP+pbpi4el/t6m49BDJ25y9bYXfyzY5Rzhx K4cAdKMSr8r7Q4heQPLZBv9dp4HDdBAog7NzXpL911BD6frY7eosbwPm13wVw/V/MDo1 5Ewc2iGGaBByTn1lJJMONLJt17DL1FaysRDOQlM/NzQZjwEb8U+qvV74yR+3QOL+NRHJ Kq+hfSXgnQnZRpEY6NMuIvkRRDYJY2+0q0bjugX9BIsj3NgkQPQmlxeJAO/o07g0p7Fw c2jktIv6Cry6oIlffYak5kl7Hfd4Tj3papINMvmUX8LmlSh525pRzLF7+imG8crXPwu0 sBFg== X-Gm-Message-State: ALoCoQlZbXOHE0s2Rmgqu8rh02cSvHWqeHx0JkN5aaVCDHjZFth53MlnU7bcMHGAjyr8qrct8uoE MIME-Version: 1.0 X-Received: by 10.224.88.134 with SMTP id a6mr58834045qam.28.1414969042556; Sun, 02 Nov 2014 14:57:22 -0800 (PST) In-Reply-To: <5456B3E6.4040907@eastlink.ca> References: <5456984A.3020001@eastlink.ca> <20141102213713.GA4412@chaz.gmail.com> <5456B3E6.4040907@eastlink.ca> Date: Sun, 2 Nov 2014 14:57:22 -0800 Message-ID: Subject: Re: for loop question From: Bart Schaefer To: Zsh Users Content-Type: multipart/alternative; boundary=001a11c2bbba2670960506e827c2 --001a11c2bbba2670960506e827c2 Content-Type: text/plain; charset=UTF-8 On Nov 2, 2014 2:42 PM, "Ray Andrews" wrote: > > But it does show that 'for ((' CAN stop and digest ' [ -n "$TLC[i]" ] ' if it wants too, > it just has to make it obscenely difficult. Why can't the truth test of a command just be taken > as 'arithmetic' plain and simple? It's a matter of order-of-evaluation and contextual tokenization. Once the parser encounters "for ((" it stops looking for ordinary shell command tokens and starts looking for math tokens; a word like "test" in that context is a numeric variable name, not a command name, and "[" has another meaning as well. But "$" introduces an expansion in either context, so $(...) switches back into the regular parsing mode. --001a11c2bbba2670960506e827c2--