Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: "break" and functions
- X-seq: zsh-workers 52845
- From: Mikael Magnusson <mikachu@xxxxxxxxx>
- To: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- Cc: Zsh hackers list <zsh-workers@xxxxxxx>
- Subject: Re: "break" and functions
- Date: Fri, 29 Mar 2024 10:30:07 +0100
- Archived-at: <https://zsh.org/workers/52845>
- In-reply-to: <CAH+w=7bb9BKUCvqCb=A-Qw36+HVn-NszP2DfQeXsYmKs-HVWFg@mail.gmail.com>
- List-id: <zsh-workers.zsh.org>
- References: <CAH+w=7bb9BKUCvqCb=A-Qw36+HVn-NszP2DfQeXsYmKs-HVWFg@mail.gmail.com>
On Fri, Mar 29, 2024 at 2:55 AM Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
>
> On Wed, Mar 27, 2024 at 3:22 PM Oliver Kiddle <opk@xxxxxxx> wrote:
> >
> > Perhaps worth including in a test case is the following which does
> > break after running the echo.
> > while :; do; echo ${|REPLY=x;break}; done
>
> When adding this, I ran into a puzzling effect:
>
> % while :; do; echo ${|REPLY=x;break}; done
> x
> % while :; do; () { echo "$@" } ${|REPLY=x;break}; done
> %
>
> That is, breaking the loop skips the function call but does not skip
> the builtin.
>
> I think something like this has been mentioned before in different
> context, but it's not easy to search for.
51608
--
Mikael Magnusson
Messages sorted by:
Reverse Date,
Date,
Thread,
Author