Re: Loops and pipes
Bart Schaefer <[email protected]> Fri, 31 Jul 2026 20:55:22 -0700
| Newsgroups | gmane.comp.shells.zsh.devel |
|---|---|
| Message-ID | <CAH+w=7bj2yiU_o5jv9Q=J5FHxoCX9j3fn5OKTCBQhvk2qsr7pw@mail.gmail.com> |
On Fri, Jul 31, 2026 at 2:38=E2=80=AFPM Bart Schaefer <schaefer@brasslanter= n.com> wrote: > > continue and break on the left side of a pipe are useless. I see that it's not completely useless. > Would anyone have an issue with break / continue causing an error if > either appears in a subshell where the surrounding loop is in the > parent? Counter-example: for x in 1 2 3; do (echo IN $x; break; echo OUT $x); done IN 1 IN 2 IN 3 It'd take some finagling to get break/continue to propagate up. Hijack a signal? Reserve an exit status of the subshell?