Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: dangerous behavior of while in zsh 5.6 ?
- X-seq: zsh-users 23701
- From: Marc Chantreux <eiro@xxxxxxxxx>
- To: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- Subject: Re: dangerous behavior of while in zsh 5.6 ?
- Date: Wed, 3 Oct 2018 23:06:14 +0200
- Cc: Zsh Users <zsh-users@xxxxxxx>
- Dkim-filter: OpenDKIM Filter v2.10.3 aurora-borealis.phear.org AB67B10699
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/simple; d=phear.org; s=20180217; t=1538600775; bh=x3BD+iwRtYK86F8Lkj4hWXwn18mr290yV3bqrIzWpZg=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=so27AhLyI9L36oqR8dhUed5foGfef9eoJB79PgZEWq4GGPKq+CA2wfZJ+aciTOYSv PauAsIm9ef+m6EQHWPrLEBHM88Fp+SQ+25Y2+P3mvOIqgRvjNHisfjs1sez8SwzLMp V+ke9jS4SJ7twciMxP2s+z/X2SxUZJtvhET1Jc/iSqn9uN9Q3oHj5bZzef0AZk0HJX FEQzosrxCStAwO52XNclPpSVvuTcVUojbT0MarCMsCqWD0ppGJOfNzBufvsEEFsPWV /gs8vNpKmfbhUdmp3CdJ19JrdyYgKL39kPfR4Cz/qthSrm9W+aX/95mn/Crkasw8jJ ucXSJb/5xhwgA==
- In-reply-to: <CAH+w=7adyJUKgfCQz6yzEMUDMyqEi-B+akhi0Py4R37C-y82YQ@mail.gmail.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>
- List-unsubscribe: <mailto:zsh-users-unsubscribe@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <20181003143800.GA9162@prometheus.u-strasbg.fr> <CAH+w=7ZuFKDMBvL7XdSqYXcXy5hrc_zQPK0KsLrTZ1Szrfu6Ow@mail.gmail.com> <20181003162552.GA14697@prometheus.u-strasbg.fr> <CAH+w=7adyJUKgfCQz6yzEMUDMyqEi-B+akhi0Py4R37C-y82YQ@mail.gmail.com>
hello,
repeat 2 print $[i++]
while ((i--))
print $i
> > { repeat 2 print $[i++]
> > while (( i-- )) print $i
> > } |sed 10 | xargs
> This shows a critical missing bit of detail from your original
> message: The while loop is inside a { } expression.
the way i wrote it was only to demonstrate but this is another example:
# grep -n . /tmp/a.zsh
1:repeat 2 print $[i++]
2:while ((i--))
3: print $i
# zsh /tmp/a.zsh | sed 10q
0
1
1
0
-1
-2
-3
-4
-5
-6
regards
marc
Messages sorted by:
Reverse Date,
Date,
Thread,
Author