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 19:36:29 +0300

On Mon, Jul 29, 2013 at 7:04 PM, Pierre Gaston <pierre.gaston@gmail.com> wrote:
> On Mon, Jul 29, 2013 at 6:44 PM, Greg Wooledge <wooledg@eeg.ccf.org> wrote:
>> On Mon, Jul 29, 2013 at 06:36:58PM +0300, Pierre Gaston wrote:
>>> 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.
>>
>> "Most people" barely know what a subshell is.
>
> Sure, but even If I know what it is,  it's still not clear why return
> would only exit the process
> since it sounds something more related to the concept of "functions".
>
Well, it's clear if you think about what the parent shell knows. It
only knows the exit status of the subshell and it cannot know if it
exited because of a "return" or a "break" or "exit" or something else.



reply via email to

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