Re: 'return' from subshell in function doesn't

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



2020-03-08 15:19:01 +0000, Harald van Dijk:
[...]
> The same problem applies to the 'break' and 'continue' statements too:
> 
>   for var in x y z
>   do
>     echo $var
>     (break)
>   done
> 
> This prints x, y, and z in all shells, the 'break' statement in the subshell
> does not cause the loop to terminate. Some shells additionally print a
> warning or error message such as "break: not in a loop". Here again,
> presumably the intent of the standard is not that the 'break' statement
> should cause the loop to terminate. It is not something that shells do, and
> it is not something that is reasonable for shells to implement.
> 
> This is looking like a giant can of worms I'm not sure I'm ready to see
> opened. :)
[...]

See https://www.austingroupbugs.net/view.php?id=842 and its
resolution
(https://www.austingroupbugs.net/view.php?id=842#c2257) about that.

-- 
Stephane



[Index of Archives]     [LARTC]     [Bugtraq]     [Yosemite Forum]     [Photo]

  Powered by Linux