bug-bash
[Top][All Lists]
Advanced

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

Re: BASH_SUBSHELL documentation misleading


From: Greg Wooledge
Subject: Re: BASH_SUBSHELL documentation misleading
Date: Thu, 24 Mar 2011 10:50:45 -0400
User-agent: Mutt/1.4.2.3i

On Thu, Mar 24, 2011 at 02:33:19PM +0000, Marc Herbert wrote:
> I would also like to see this example in the documentation:
> 
> $ ( echo sub-$BASH_SUBSHELL ); echo main-$BASH_SUBSHELL
> sub-1
> main-0

Overkill.  Most of the other features in the manual do not have such
examples, and if we added examples of this size for every single feature,
the manual would swell up to a tremendous size.  It's already quite large.

It should be enough to say that BASH_SUBSHELL is a subshell depth counter,
incremented in each new 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.

imadev:~$ ( echo 'sub-$BASH_SUBSHELL' )
sub-$BASH_SUBSHELL

What did you expect?



reply via email to

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