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?