[Top][All Lists]

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

Re: BASH_SUBSHELL documentation misleading

From: Marc Herbert
Subject: Re: BASH_SUBSHELL documentation misleading
Date: Thu, 24 Mar 2011 14:33:19 +0000
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv: Gecko/20110307 Fedora/3.1.9-0.39.b3pre.fc14 Thunderbird/3.1.9

Le 23/03/2011 20:28, Chet Ramey a écrit :
> On 3/23/11 4:15 PM, Sam Liddicott wrote:
>> Yes. But a new subshell environment has been spawned. Each time that
>> happens BASH_SUBSHELL should increase.
>> Of course I know how it does work, but the man page isn't clear. It doesn't
>> say that the increase is only visible within the subshell and therefore it
>> is a measurement of subshell depth.
> OK.  What wording would you like to see?

I would also like to see this example in the documentation:

$ ( echo sub-$BASH_SUBSHELL ); echo main-$BASH_SUBSHELL

This example answers all doubts raised in this discussion. It also
hints at the fact that:

  ( echo 'sub-$BASH_SUBSHELL' )

does not work like an inexperienced quoter could wrongly assume.

reply via email to

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