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: Mon, 29 Jul 2013 18:36:58 +0300

On Mon, Jul 29, 2013 at 6:06 PM, Chet Ramey <chet.ramey@case.edu> wrote:
> On 7/29/13 10:55 AM, Roman Rakus wrote:
>> I didn't take a look on where the problem could be, but it is discussed on
>> stackoverflow [1].
>>
>> Looks like return builtin falsely exit execution of while loop instead of
>> function.
>
> What would you like to see happen?  You're in a subshell: the function
> can't return, since this is not the shell that called it.  Do you want
> parent and child shells both continuing execution after the function call?
>

it's not clear (like it is for, say, exit) what the relationship
between return and process is.
I guess most people expect it to not care about subshells and just
execute the statement after the function call.

I'm not sure how the case foo () { return & echo foo; } would fit though.



reply via email to

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