Date:        Tue, 14 Aug 2018 09:49:00 +0100
    From:        Stephane Chazelas <stephane.chaze...@gmail.com>
    Message-ID:  <20180814084900.2zi6l43unfljn...@chaz.gmail.com>

  | but ash-based shells and zsh return with 1 for "return".

As does yash (not ash based) but the FreeBSD shell has
been altered (as it was for ! break etc) to return 0

The FreeBSD shell change is no accident, it has very
deliberate extra code added to make it happen.  So
they must believe that (for all these control exiting
keywords) that ignoring the ! is correct.   Jilles ??

  | See also:
  |
  | $ mksh -c 'for i in 1 2; do echo "$?"; (exit 3); continue; done'
  | 0
  | 3

That's just weird, the exit status of continue should be 0

  | $ mksh -c 'for i in 1 2; do echo "$?"; ! continue; done'
  | 0
  | 0

That one is at least consistent with ignoring a ! before
break or continue (or return).

kre

Reply via email to