Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: "break" and functions



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