SHLVL--shell终端深度

参考:How And Why You Would Use The $SHLVL Variable

SHLVL代表shell打开的深度,进程第一次打开shell时$SHLVL=1,然后在此shell中再打开一个shell时$SHLVL=2。

父shell的变量可以export到子shell,但子shell的变量export不影响父shell,但影响子shell的子shell。

原文地址:https://www.cnblogs.com/embedded-linux/p/7491294.html