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 23700
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: Zsh Users <zsh-users@xxxxxxx>
- Subject: Re: dangerous behavior of while in zsh 5.6 ?
- Date: Wed, 3 Oct 2018 13:54:46 -0700
- Cc: Marc Chantreux <eiro@xxxxxxxxx>
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=JNyW/dLlPzqSUTaznVH2es2D6WiiLQiGbdhQ4EgJapk=; b=Afw717TDIcKRW9GfI91GXh4vtVmXCG1fX+n7K9RVnHUQN8VqMOugDRwhfkLGpv4uXO JaO0J2iXwIoeR1oSKf2u8w0VdTZ1+MyTWxzPXpsE3/6EOCQ33Z7oAZPLwcwQliMtzZFI kLq1HPmQO0ZHDfZBk62++aOxSVhiKqZay6R0r5pHJxfDa8T29q2XZPU5Und8QFPZ3A02 QsY6q+nj6SHqIy/K7tQ4YMEeZIrYh0lwU1jW7biZ1zNNO0sVwLd98o2a7rz4OTkxN21t Lp0ZxcEzg20UlQPDcOLQQcNbMIe92jWfUYf1mHooiTW6KJtKDy7xTl8DoI7EPBLOw0vT SE2g==
- In-reply-to: <20181003162552.GA14697@prometheus.u-strasbg.fr>
- 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>
On Wed, Oct 3, 2018 at 9:26 AM Marc Chantreux <eiro@xxxxxxxxx> wrote:
>
> i have the same behavior when interactive but no syntax error otherwise.
>
> instead:
>
> { 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 parser
treats the close-brace as terminating the loop with an empty body. If
this had been in a script file with end-of-file at that point, you
would have received the syntax error.
% { while false
cursh while> }
%
This potentially does indicate a parsing problem in 5.6, because in 5.0:
% { while false
cursh while> }
zsh: parse error near `}'
Messages sorted by:
Reverse Date,
Date,
Thread,
Author