bug-bash
[Top][All Lists]
Advanced

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

Re: Bug in function return statement in while subshell


From: Pierre Gaston
Subject: Re: Bug in function return statement in while subshell
Date: Tue, 30 Jul 2013 12:45:25 +0300

On Tue, Jul 30, 2013 at 12:29 PM, Chris Down <chris@binary.com> wrote:
> On 2013-07-30 12:11, Pierre Gaston wrote:
>> what about things like this: foo () (  return 1; )
>
> Except in this case, the return has a valid context. I don't see how it's 
> really
> comparable to the represented case.

It's a return in a subshell in a function, i don't think the
comparison is far fetched.
I see what you mean,  but that raises the question of what's a valid context.
Should we make a special case if the subshell is the "outer" compound
command of a function?

The same thing with by break and continue example:

while :;do ( while :;do break 2; done);echo foo;done

Should this raise an error? is the break in a loop context? what's a
loop context?



reply via email to

[Prev in Thread] Current Thread [Next in Thread]