Nesting Level of Subshells

$BASH_SUBSHELL is the nesting level of subshell or subshell environments.

Examples

Print subshell nesting :

1
echo "$BASH_SUBSHELL $(echo -n "$BASH_SUBSHELL $(echo -n $BASH_SUBSHELL)")"

Output: 0 1 2

BashSupport Pro 是一个 支持 $BASH_SUBSHELL 的 Bash 集成开发工具 – 马上试用!
© 2020–2022 Joachim Ansorg
声明
隐私政策
许可条款