[Top][All Lists]

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

BASH_SUBSHELL documentation misleading

From: Sam Liddicott
Subject: BASH_SUBSHELL documentation misleading
Date: Wed, 23 Mar 2011 16:12:31 -0000
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv: Gecko/20110322 Lanikai/3.1.10pre

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

        man page says:

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

        As it behaves more like a depth counter than a serial number
        maybe it should say

Incremented by one in each nested subshell or subshell evironment.
              It is always 0 when $BASH_PID=$$

reply via email to

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