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

"break" and functions



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.




Messages sorted by: Reverse Date, Date, Thread, Author