Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: for loop question
- X-seq: zsh-users 19329
- From: Stephane Chazelas <stephane.chazelas@xxxxxxxxx>
- To: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- Subject: Re: for loop question
- Date: Tue, 4 Nov 2014 07:08:36 +0000
- Cc: zsh-users@xxxxxxx
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:mail-followup-to:references :mime-version:content-type:content-disposition:in-reply-to :user-agent; bh=/EYvFIZ5mVtvtOugudOzUClRUxBG2wLKSbLNaJvf/jY=; b=j7lBG1/0waA+7vhJms2z1lY6SRsLoaaaFm7huRsoldWESjNXcmPXnGwmSAHEmUMK6D HrTegLkx4CIU6PQUc35K/jWNxZBvQKECVpLTnOXCIS0koHX578wxJEVqQvi3oCjwbkIL b9zjkNAFvCiC0tlb9gFaKU9lcoz9KIU/raSjk8Rmepwi4PRHFgh/r9Kcj+rg4/CbJpHy EvBJ98r67mX93sLMDldrXaipqlNwDzl4CmHMtChQCy3m+LpruBxFx06WUjLu7j46Lejt t7zBg8mf00FqT4K6BkaKGgbJ/WE1XdMhNmS+Ip0k8EEYpD5GyfLKK8ZPpzl+uPJnVl0j 36vg==
- In-reply-to: <141103184338.ZM32221__48957.5251042426$1415069142$gmane$org@torch.brasslantern.com>
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mail-followup-to: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>, zsh-users@xxxxxxx
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <5456984A.3020001@eastlink.ca> <CAH+w=7aWS0xyS4CXRJBphDjesfUFQOsyJRMaG3RZRxmuj7xkOg__20885.3257158355$1414962125$gmane$org@mail.gmail.com> <20141102213713.GA4412@chaz.gmail.com> <20141104015639.GA2871@localhost.localdomain> <141103184338.ZM32221__48957.5251042426$1415069142$gmane$org@torch.brasslantern.com>
2014-11-03 18:43:38 -0800, Bart Schaefer:
[...]
> This could be written a LOT more plainly as
>
> for ((i=1; $([ -n "$TLC[i]" ]; echo $?) == 0; i++))
[...]
Oh, for some reason, I didn't expect that to work assuming the
$(...) would be expanded only once before the loop starts which
of course was stupid. It was not my intention to obfuscate the
code.
--
Stephane
Messages sorted by:
Reverse Date,
Date,
Thread,
Author