Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Bug with continue?
- X-seq: zsh-workers 51610
- From: Peter Stephenson <p.w.stephenson@xxxxxxxxxxxx>
- To: zsh workers <zsh-workers@xxxxxxx>
- Subject: Re: Bug with continue?
- Date: Wed, 29 Mar 2023 11:02:56 +0100 (BST)
- Archived-at: <https://zsh.org/workers/51610>
- Importance: Normal
- In-reply-to: <805138511.3622784.1680002886460@mail.virginmedia.com>
- List-id: <zsh-workers.zsh.org>
- References: <CAMP44s3NCDJU9TcSuSgy5oH=-iK3zpP3Vc1+95d3n16uydHhFA@mail.gmail.com> <16795430.3614208.1679998628194@mail.virginmedia.com> <805138511.3622784.1680002886460@mail.virginmedia.com>
> On 28/03/2023 12:28 Peter Stephenson <p.w.stephenson@xxxxxxxxxxxx> wrote:
> > On 28/03/2023 11:17 Peter Stephenson <p.w.stephenson@xxxxxxxxxxxx> wrote:
> > > On 28/03/2023 10:32 Felipe Contreras <felipe.contreras@xxxxxxxxx> wrote:
> > > I notice this works differently in zsh than in other shells:
> > >
> > > for x in 1 2 3 4; do
> > > continue &&
> > > list="$list$x " &&
> > > echo "x: $x"
> > > done
> > > echo "list: $list"
> > >
> > > Why did the statement after `continue` gets evaluated?
>
> This one is a little weird as if the immediately next statement is a
> print it doesn't get executed.
For what it's worth, I suspect this difference is because the
assignment is going through execsimple() rather than the execcmd_...
series. As it's name suggests execsimple() doesn't do a lot of testing.
I'd rather not tinker with that; the fix we have should be good enough.
pws
Messages sorted by:
Reverse Date,
Date,
Thread,
Author