[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: BASH_SUBSHELL documentation misleading
From: |
Chris F.A. Johnson |
Subject: |
Re: BASH_SUBSHELL documentation misleading |
Date: |
Wed, 23 Mar 2011 14:52:51 -0400 (EDT) |
User-agent: |
Alpine 2.00 (LMD 1167 2008-08-23) |
On Wed, 23 Mar 2011, Sam Liddicott wrote:
Configuration Information [Automatically generated, do not change]:
Machine: i686
OS: linux-gnu
Compiler: gcc
Compilation CFLAGS: -DPROGRAM='bash' -DCONF_HOSTTYPE='i686'
-DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='i686-pc-linux-gnu'
-DCONF_VENDOR='pc' -DLOCALEDIR='/usr/share/locale' -DP$ uname output: Linux
sojo 2.6.35-28-generic-pae #49-Ubuntu SMP Tue Mar 1 14:58:06 UTC 2011 i686
GNU/Linux
Machine Type: i686-pc-linux-gnu
Bash Version: 4.1
Patch Level: 5
Release Status: release
Description:
man page says:
BASH_SUBSHELL
Incremented by one each time a subshell or subshell
environment
is spawned. The initial value is 0.
This suggests that:
echo $BASH_SUBSHELL ; ( echo ) ; echo $BASH_SUBSHELL
would not give the same answer for BASH_SUBSHELL
No, it suggests that:
echo $BASH_SUBSHELL ; ( echo $BASH_SUBSHELL )
would not give the same answer for BASH_SUBSHELL
In your example, the second "echo $BASH_SUBSHELL" is at the same
depth as the first.
--
Chris F.A. Johnson, <http://cfajohnson.com/>
Author:
Pro Bash Programming: Scripting the GNU/Linux Shell (2009, Apress)
Shell Scripting Recipes: A Problem-Solution Approach (2005, Apress)
- BASH_SUBSHELL documentation misleading, Sam Liddicott, 2011/03/23
- Re: BASH_SUBSHELL documentation misleading,
Chris F.A. Johnson <=
- Re: BASH_SUBSHELL documentation misleading, Sam Liddicott, 2011/03/23
- Re: BASH_SUBSHELL documentation misleading, Marc Herbert, 2011/03/24
- Re: BASH_SUBSHELL documentation misleading, Greg Wooledge, 2011/03/24
- Re: BASH_SUBSHELL documentation misleading, Marc Herbert, 2011/03/24
- Re: BASH_SUBSHELL documentation misleading, Greg Wooledge, 2011/03/24
- Re: BASH_SUBSHELL documentation misleading, Clark J. Wang, 2011/03/24
- Re: BASH_SUBSHELL documentation misleading, Maarten Billemont, 2011/03/23